Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#33765 closed Bug (invalid)

ManifestStaticFilesStorage doesn't support trailing whitespace for JS source map references

Reported by: Adam Johnson Owned by: Adam Johnson
Component: contrib.staticfiles Version: 4.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Adam Johnson)

#32383 added support for JS source map references, but the regex is incomplete. Browsers ignore trailing whitespace in source map references, but the regex we added did not allow for that. Whilst trailing whitespace is unlikely to be used, since source maps are normally generated by automated tools that shouldn't add it, we should ignore it to match browser behaviour.

Spotted during discussion on this PR for a similar fix on CSS source map references.

(Also as discussed, I tested the inital space being a tab, or more than one space, and those options are not supported by Firefox.)

Change History (4)

comment:1 by Adam Johnson, 2 years ago

Description: modified (diff)

comment:2 by Mariusz Felisiak, 2 years ago

Has patch: set
Owner: changed from nobody to Adam Johnson
Severity: NormalRelease blocker
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:3 by Mariusz Felisiak, 2 years ago

Resolution: invalid
Severity: Release blockerNormal
Status: assignedclosed
Triage Stage: AcceptedUnreviewed

It works without any changes.

comment:4 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

In 00639db:

Refs #33765 -- Added tests for trailing whitespace in JavaScript source map references.

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