mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: error in response body to blocked crawlers, showing 500 Internal Server Error with status of 403
This commit is contained in:
@ -167,7 +167,7 @@ describe Middleware::AnonymousCache::Helper do
|
||||
"PATH_INFO" => path,
|
||||
"REQUEST_PATH" => path
|
||||
}.merge(options[:headers]))
|
||||
@status = middleware.call(@env).first
|
||||
@status, @response_header, @response = middleware.call(@env)
|
||||
end
|
||||
|
||||
it "applies whitelisted_crawler_user_agents correctly" do
|
||||
@ -184,6 +184,7 @@ describe Middleware::AnonymousCache::Helper do
|
||||
}
|
||||
|
||||
expect(@status).to eq(403)
|
||||
expect(@response).to be_an(Array)
|
||||
|
||||
get '/', headers: non_crawler
|
||||
expect(@status).to eq(200)
|
||||
|
Reference in New Issue
Block a user