Fix local HTTP Safari loads by disabling HTTPS upgrade headers#1623
Open
danielbnelson wants to merge 1 commit intomnfst:mainfrom
Open
Fix local HTTP Safari loads by disabling HTTPS upgrade headers#1623danielbnelson wants to merge 1 commit intomnfst:mainfrom
danielbnelson wants to merge 1 commit intomnfst:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes blank-page behavior in Safari for local/self-hosted HTTP installs.
Root cause
Manifest was sending security directives that are appropriate for HTTPS deployments
but break plain HTTP local installs in Safari:
Strict-Transport-Securityupgrade-insecure-requestsSafari upgraded same-origin local subresource requests to
https://..., whichcaused TLS failures for JS, CSS, fonts, and startup assets.
Changes
BETTER_AUTH_URLis actually HTTPSupgrade-insecure-requestsin CSPValidation
Tested against a local Docker/self-hosted instance on plain HTTP.
npm run buildcompleted successfullySummary by cubic
Fixes Safari blank page on local/self-hosted HTTP by disabling HTTPS upgrade headers in
helmet. HSTS now only applies whenBETTER_AUTH_URLis HTTPS, and CSP no longer upgrades requests on HTTP.BETTER_AUTH_URLstarts withhttps://.upgradeInsecureRequests: nullto stop Safari from rewriting same-origin assets to HTTPS on HTTP.Written for commit 9ed618c. Summary will update on new commits.