mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
SECURITY: Remove ember-cli specific response from application routes (#15155)
Under some conditions, these varied responses could lead to cache poisoning, hence the 'security' label. Previously the Rails application would serve JSON data in place of HTML whenever Ember CLI requested an `application.html.erb`-rendered page. This commit removes that logic, and instead parses the HTML out of the standard response. This means that Rails doesn't need to customize its response for Ember CLI.
This commit is contained in:
@ -647,10 +647,4 @@ module ApplicationHelper
|
||||
current_user ? nil : value
|
||||
end
|
||||
end
|
||||
|
||||
def hijack_if_ember_cli!
|
||||
if request.headers["HTTP_X_DISCOURSE_EMBER_CLI"] == "true"
|
||||
raise ApplicationController::EmberCLIHijacked.new
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user