Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(service-worker): correctly serve
ngsw/state
with a non-root SW …
…scope (#37922) The Angular ServiceWorker can serve requests to a special virtual path, `ngsw/state`, showing [information about its internal state][1], which can be useful for debugging. Previously, this would only work if the ServiceWorker's [scope][2] was the root directory (`/`). Otherwise, (e.g. when building the app with `--baseHref=/some/path/`), the ServiceWorker would fail to detect a request to `/some/path/ngsw/state` as matching `ngsw/state` and would not serve it with the debugging information. This commit fixes it by ensuring that the ServiceWorker's scope is taken into account when detecting a request to `ngsw/state`. [1]: https://angular.io/guide/service-worker-devops#locating-and-analyzing-debugging-information [2]: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/scope Fixes #30505 PR Close #37922
- Loading branch information