diff --git a/app/assets/javascripts/bootstrap-json/index.js b/app/assets/javascripts/bootstrap-json/index.js index 323a16816d3..0a091b8407d 100644 --- a/app/assets/javascripts/bootstrap-json/index.js +++ b/app/assets/javascripts/bootstrap-json/index.js @@ -343,9 +343,9 @@ async function handleRequest(proxy, baseURL, req, res) { const csp = response.headers.get("content-security-policy"); if (csp) { const emberCliAdditions = [ - `http://${originalHost}/assets/`, - `http://${originalHost}/ember-cli-live-reload.js`, - `http://${originalHost}/_lr/`, + `http://${originalHost}${baseURL}assets/`, + `http://${originalHost}${baseURL}ember-cli-live-reload.js`, + `http://${originalHost}${baseURL}_lr/`, ].join(" "); const newCSP = csp @@ -516,7 +516,7 @@ to serve API requests. For example: return false; } - if (request.path.startsWith("/_lr/")) { + if (request.path.startsWith(`${baseURL}_lr/`)) { return false; } diff --git a/app/controllers/stylesheets_controller.rb b/app/controllers/stylesheets_controller.rb index 1d6c77f0a65..24abd4151b2 100644 --- a/app/controllers/stylesheets_controller.rb +++ b/app/controllers/stylesheets_controller.rb @@ -39,7 +39,7 @@ class StylesheetsController < ApplicationController cache_time = request.env["HTTP_IF_MODIFIED_SINCE"] - if cache_time + if cache_time.present? begin cache_time = Time.rfc2822(cache_time) rescue ArgumentError @@ -63,7 +63,7 @@ class StylesheetsController < ApplicationController handle_missing_cache(location, target, digest) if !stylesheet_time - if cache_time && stylesheet_time && stylesheet_time <= cache_time + if cache_time.present? && stylesheet_time && stylesheet_time <= cache_time return render body: nil, status: 304 end