Add port to redirect URL when server port is 80 #741
Closed
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.
Describe in detail the problem you had and how this PR fixes it
This fixes HTTP to HTTPS redirects when people are running code-server on port 80 (default HTTP port).
Essentially, if code-server's port is 80 and is accessed over HTTP, code-server would redirect to HTTPS without adding
:80
to the end of the URL, resulting in the browser accessing over port 443.I'm hesitant about this PR as it could cause problems with reverse proxies but unable to try multiple reverse proxy scenarios. I don't think this should be merged until reverse proxies are tested and everything works as expected.
Is there an open issue you can link to?
#737
I've made another PR for changing the documentation that lead the user in the above issue to using port 80: #740