angular-cn/packages/service-worker
George Kalpakas 2156beed0c 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
2020-07-09 09:44:56 -07:00
..
cli build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
config build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
src docs(service-worker): update default value of `SwRegistrationOptions#registrationStrategy` (#37555) 2020-06-15 09:48:55 -07:00
test build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
testing build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
worker fix(service-worker): correctly serve `ngsw/state` with a non-root SW scope (#37922) 2020-07-09 09:44:56 -07:00
BUILD.bazel refactor(dev-infra): ng_rollup_bundle rule should leverage `@bazel/rollup` (#37623) 2020-06-22 10:55:28 -07:00
PACKAGE.md docs: add package doc files (#26047) 2018-10-05 15:42:14 -07:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json Revert "build: remove wombot proxy registry from package.jsons for release (#37378)" (#37495) 2020-06-10 08:21:45 -07:00
public_api.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
safety-worker.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00