#26249: ManifestStaticFilesStorage crashes on absolute URLs
-------------------------------------+-------------------------------------
     Reporter:  aaugustin            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.staticfiles  |                  Version:  1.9
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Aymeric Augustin <aymeric.augustin@…>):

 In [changeset:"7f6fbc906a21e9f8db36e06ace2a9b687aa26130" 7f6fbc9]:
 {{{
 #!CommitTicketReference repository=""
 revision="7f6fbc906a21e9f8db36e06ace2a9b687aa26130"
 Prevented static file corruption when URL fragment contains '..'.

 When running collectstatic with a hashing static file storage backend,
 URLs referencing other files were normalized with posixpath.normpath.
 This could corrupt URLs: for example 'a.css#b/../c' became just 'c'.

 Normalization seems to be an artifact of the historical implementation.
 It contained a home-grown implementation of posixpath.join which relied
 on counting occurrences of .. and /, so multiple / had to be collapsed.

 The new implementation introduced in the previous commit doesn't suffer
 from this issue. So it seems safe to remove the normalization.

 There was a test for this normalization behavior but I don't think it's
 a good test. Django shouldn't modify CSS that way. If a developer has
 rendundant /s, it's mostly an aesthetic issue and it isn't Django's job
 to fix it. Conversely, if the user wants a series of /s, perhaps in the
 URL fragment, Django shouldn't destroy it.

 Refs #26249.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26249#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.469d75c0b3b5a5977d39cedcde5be4b8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to