Skip to content

pwa can't cache resource with space in url #25443

@zh99998

Description

@zh99998

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

when where is a resources in assets directory, and filename includes space " ", the @angular/pwa service worker can't cache it correctly.

Expected behavior

Minimal reproduction of the problem with instructions

ng add @angular/pwa
put an image named "a b.jpg" in assets
reference it in html
ng build --prod

open it in browser
enable offline mode in chrome devtools
refresh page
it will got a 504.

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Browser:
- [x] Chrome (desktop) version 68
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: service-workerIssues related to the @angular/service-worker packageeffort1: hoursfreq1: lowstate: confirmedtype: bug/fix

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions