ng build --prod forces background url parameters to alphabetical order
See original GitHub issueBug Report or Feature Request (mark with an x)
- [x] bug report
- [ ] feature request
Versions.
@angular/cli: 1.0.4 node: 7.10.0 os: darwin x64 @angular/common: 4.1.3 @angular/compiler: 4.1.3 @angular/core: 4.1.3 @angular/forms: 4.1.3 @angular/http: 4.1.3 @angular/platform-browser: 4.1.3 @angular/platform-browser-dynamic: 4.1.3 @angular/router: 4.1.3 @angular/cli: 1.0.4 @angular/compiler-cli: 4.1.3
Repro steps.
When running ng build --prod, query parameters of background-image URLs in my scss file are not maintained in the same order they were.
The log given by the failure.
Original line in scss file:
background: url('https://fnbfb.imgix.net/https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Ffamilinb-web.appspot.com%2Fo%2FUnused%2520-%252054148193_xxl.jpg%3Falt%3Dmedia%26token%3D25f08c08-ed7d-4b3b-a041-4368f8d8d451?auto=format&fit=crop&w=600&h=400&expires=1496488841&s=3bdd3f89855db0ee92aaa2db61f3ffe4')
Line in main.xxx.bundle.js:
background:url(https://fnbfb.imgix.net/https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Ffamilinb-web.appspot.com%2Fo%2FUnused%20-%2054148193_xxl.jpg%3Falt%3Dmedia%26token%3D25f08c08-ed7d-4b3b-a041-4368f8d8d451?auto=format&expires=1496488841&fit=crop&h=400&s=3bdd3f89855db0ee92aaa2db61f3ffe4&w=600)
Desired functionality.
If the order is not maintained, imgix does not validate the signature. Also, the s parameter has to go in the end.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)

Top Related StackOverflow Question
This no longer happens in 1.7 (currently in beta). But fixed is really the inappropriate word. As explained above and more completely by @metaloha , this is really an issue with the service being used and not the act of alphabetizing or otherwise sorting the parameters. Note also that a future optimizer/minifier could be used that again does so.
This seems more like a defect with the signature checking process. Relying on query parameter order doesn’t seem like the best idea and the signature validation could be changed to handle order independence.