FIX: Ember CLI was losing some preloaded data (#13406)

The `bootstrap.json` contains most preloaded information but some routes
provide extra information, such as invites.

This fixes the issue by having the preload request pass on the preloaded
data from the source page, which is then merged with the bootstrap's
preloaded data for the final HTML payload.
This commit is contained in:
Robin Ward
2021-06-16 13:45:02 -04:00
committed by GitHub
parent 20dbcbf022
commit 651b8a23b8
2 changed files with 21 additions and 11 deletions

View File

@ -322,7 +322,9 @@ class ApplicationController < ActionController::Base
end
def send_ember_cli_bootstrap
head 200, content_type: "text/html", "X-Discourse-Bootstrap-Required": true
response.headers['X-Discourse-Bootstrap-Required'] = true
response.headers['Content-Type'] = "application/json"
render json: { preloaded: @preloaded }
end
# If a controller requires a plugin, it will raise an exception if that plugin is