mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
FIX: handle CORS in hijacked requests
This commit is contained in:
@ -55,6 +55,11 @@ module Hijack
|
||||
body = response.body
|
||||
|
||||
headers = response.headers
|
||||
# add cors if needed
|
||||
if cors_origins = env_copy[Discourse::Cors::ORIGINS_ENV]
|
||||
Discourse::Cors.apply_headers(cors_origins, env_copy, headers)
|
||||
end
|
||||
|
||||
headers['Content-Length'] = body.bytesize
|
||||
headers['Content-Type'] = response.content_type || "text/plain"
|
||||
headers['Connection'] = "close"
|
||||
|
Reference in New Issue
Block a user