mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 13:14:30 +03:00
Only set the script_prefix if the prefix isn't already a full URL.
This commit is contained in:
parent
ccbb536896
commit
7b6c56a73b
|
@ -115,8 +115,9 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
|
||||||
|
|
||||||
# Calls to 'reverse' will not be fully qualified unless we set the scheme/host/port here.
|
# Calls to 'reverse' will not be fully qualified unless we set the scheme/host/port here.
|
||||||
orig_prefix = get_script_prefix()
|
orig_prefix = get_script_prefix()
|
||||||
prefix = '%s://%s' % (request.is_secure() and 'https' or 'http', request.get_host())
|
if not (orig_prefix.startswith('http:') or orig_prefix.startswith('https:')):
|
||||||
set_script_prefix(prefix + orig_prefix)
|
prefix = '%s://%s' % (request.is_secure() and 'https' or 'http', request.get_host())
|
||||||
|
set_script_prefix(prefix + orig_prefix)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.initial(request, *args, **kwargs)
|
self.initial(request, *args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user