Opened 14 years ago
Closed 14 years ago
#17806 closed Bug (fixed)
CachedFilesMixin url_converter doesn't handle absolute paths correctly
| Reported by: | lpetre | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.staticfiles | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | no |
Description
This code works fine for an absolute url that is within one folder of static, ie: url(/static/foo/bar.png)
The bug I'm seeing happens with absolute paths and multiple subfolders: url(/static/foo/bar/yak.png)
All of the logic is within CachedFilesMixin -> url_converter -> converter
The result of the bug is: When you're using any staticfile storage that includes CachedFilesMixin, collecstatic fails (throws an exception) when it tries to update a css file that has an absolute reference to another asset that is in a subfolder.
I've created a small test application here:
https://github.com/lpetre/django-cachedstorage-bug
I've also added regressiontests and a potential fix to a fork of the django project on github. I'll update this ticket shortly with that url.
Attachments (2)
Change History (4)
by , 14 years ago
| Attachment: | ticket17806_tests.diff added |
|---|
comment:1 by , 14 years ago
| Has patch: | set |
|---|---|
| Patch needs improvement: | set |
| Type: | Uncategorized → Bug |
This diff adds some regression tests that demonstrate the bug