angular-cn/packages/service-worker/worker/test
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
..
BUILD.bazel test: setup circular dependency tests for all entry points (#34774) 2020-01-23 11:36:40 -08:00
data_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
happy_spec.ts fix(service-worker): correctly serve `ngsw/state` with a non-root SW scope (#37922) 2020-07-09 09:44:56 -07:00
idle_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
prefetch_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00