Skip to content

fix(webClientServer): use relative path in logoutEndpointUrl #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 24, 2021

Conversation

jsjoeio
Copy link

@jsjoeio jsjoeio commented Nov 23, 2021

Description

This patches the webClientServer to ensure the logoutEndpointUrl is relative to the root.
This ensures the correct URL in case code-server is being served behind a
reverse proxy.

An example of this would be using Caddy to server code-server on
localhost:8082/code/

This fix ensures logging out makes a request to localhost:8082/code/logout instead
of localhost:8082/logout

Video

Before

Screen.Recording.2021-11-23.at.4.01.12.PM.mov

After

Screen.Recording.2021-11-23.at.4.03.14.PM.mov

Testing Plan

I tested against the root and the reverse-proxy.

  1. cd vscode && git checkout jsjoeio-fix-csp-reverse-proxy
  2. yarn link
  3. cd code-server && yarn link code-oss-dev --modules-folder vendor/modules
  4. create Caddyfile somewhere:
http://localhost:8082/code/* {
  uri strip_prefix /code
  reverse_proxy 127.0.0.1:8080
}
  1. caddy run
  2. Navigate to http://localhost:8082/code/ in the browser
  3. Open Menu and click Sign out

This PR fixes https://github.com/cdr/code-server/issues/4476

(There is a chance this fixes other reverse proxy issues, but I will test after this is merged).

@jsjoeio jsjoeio self-assigned this Nov 23, 2021
@jsjoeio jsjoeio added the bug Something isn't working label Nov 23, 2021
@jsjoeio jsjoeio marked this pull request as ready for review November 23, 2021 23:05
@GirlBossRush GirlBossRush merged commit 1801d59 into main Nov 24, 2021
@GirlBossRush GirlBossRush deleted the jsjoeio-fix-logout branch November 24, 2021 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants