Include browser port in sign-on dialog URL - #4
Open
cgalo5758 wants to merge 1 commit into
Open
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.
Following on from the secure cookies change: a farm can now run over plain http on any port, but the sign-on dialog still opens on the portless farm domain. On
http://site.localtest.me:8092the popup goes to port 80 and never loads.The client used one value for both the dialog host and the cookie domain. A dialog URL needs the port, but a cookie
domain=attribute must not have one, so appending the port server-side would break the cookies. This splits them:cookieDomainstays portless (wikiHost, falling back tolocation.hostname) and the dialog host addslocation.portwhen present.expectOriginfollows from the dialog URL, and thewikiNamecookie value keepslocation.hostwith the port, which done.html needs for its postMessage target.This also fixes the standalone fallback, which put
host:portinto the cookiedomain=attribute. Browsers reject that, so those cookies were silently dropped on non-default ports.This is the client half: in farm mode the farm runner also strips the port from each site's
urloption, so trusted origins stay portless. There's a matching PR for that in fedwiki/wiki. On default ports nothing changes.Tested:
npm run build:clientand prettier pass (npm test... there is nothing for that yet... so not doing it)