[3.1.x] Fixed #32304 -- Fixed prefixing STATIC_URL and MEDIA_URL by SCRIPT_NAME for absolute URLs with no domain.

Thanks Adam Hooper for the report.

Regression in c574bec092.
Backport of e13b71403b from master
This commit is contained in:
Mariusz Felisiak 2020-12-31 13:18:57 +01:00
parent 6b4b7da740
commit 5fdc81d893
3 changed files with 12 additions and 11 deletions

View file

@ -16,3 +16,9 @@ Bugfixes
* Fixed a bug in Django 3.1 that caused a crash when processing middlewares in
an async context with a middleware that raises a ``MiddlewareNotUsed``
exception (:ticket:`32299`).
* Fixed a regression in Django 3.1 that caused the incorrect prefixing of
``STATIC_URL`` and ``MEDIA_URL`` settings, by the server-provided value of
``SCRIPT_NAME`` (or ``/`` if not set), when set to a URL specifying the
protocol but without a top-level domain, e.g. ``http://myhost/``
(:ticket:`32304`).