Skip to content

Fix service worker path for reverse proxy #4477

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

Closed
jsjoeio opened this issue Nov 10, 2021 · 3 comments
Closed

Fix service worker path for reverse proxy #4477

jsjoeio opened this issue Nov 10, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 10, 2021

Reverse proxy: service worker with base path fails due to incorrect scope

@code-asher may have more details.

Introduced in #4414

@jsjoeio jsjoeio added the bug Something isn't working label Nov 10, 2021
@jsjoeio jsjoeio mentioned this issue Nov 10, 2021
46 tasks
@code-asher
Copy link
Member

To test:

  1. Spin up NGINX/Caddy/etc
  2. Serve code-server at a base path like /code
  3. Observe the service worker error

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Nov 23, 2021

I cannot reproduce this.

image

It appears that the service worker uses a relative path for the scope so maybe this is no longer an issue?

@code-asher
Copy link
Member

Ahhh this is probably because I was browsing /code and not /code/ (trailing slash).

I thought we supported this (no trailing slash on a base path) but I checked 3.10.2 and we do not. In hindsight that makes sense since we do not know what the base path is so we require the trailing slash (on the base path at least, we can still support no trailing slash on our own routes if we want).

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 a pull request may close this issue.

2 participants