Opened 7 years ago

Closed 7 years ago

#17865 closed Bug (fixed)

CachedStaticFilesStorage css rewriter should strip whitespaces from urls

Reported by: Mikhail Korobov Owned by: nobody
Component: contrib.staticfiles Version: 1.4-beta-1
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I have this rule in one of css files (note the extra whitespace in the url):

.b-error-page {
    background: url(../img/bg-error-page.png ) center 0 no-repeat;

Browsers handle this fine, collectstatic raises an exception if CachedStaticFilesStorage is used:

ValueError: The file 'img/bg-error-page.png ' could not be found with < object at 0x2ee2350>.

I think css rewriter should just strip whitespaces in such cases.

Not sure if this is relevant, but anyway: , Appendix C: "For robustness, software that accepts user-typed URI should attempt to recognize and strip both delimiters and embedded whitespace."

Change History (2)

comment:1 Changed 7 years ago by Jannis Leidel

Triage Stage: UnreviewedAccepted

comment:2 Changed 7 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

In [17696]:

(The changeset message doesn't reference this ticket)

Note: See TracTickets for help on using tickets.
Back to Top