CachedFilesMixin url_converter doesn't handle absolute paths correctly
|Reported by:||lpetre||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
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:
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.
Change History (4)
comment:1 Changed 5 years ago by
|Patch needs improvement:||set|
|Type:||Uncategorized → Bug|