Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
f5badcf8
Commit
f5badcf8
authored
Feb 20, 2012
by
Daniel Izquierdo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop using set_script_prefix
parent
af4851f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
9 deletions
+1
-9
djangorestframework/views.py
+1
-9
No files found.
djangorestframework/views.py
View file @
f5badcf8
...
@@ -181,20 +181,12 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
...
@@ -181,20 +181,12 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
Required if you want to do things like set `request.upload_handlers` before
Required if you want to do things like set `request.upload_handlers` before
the authentication and dispatch handling is run.
the authentication and dispatch handling is run.
"""
"""
# Calls to 'reverse' will not be fully qualified unless we set the
return
request
# scheme/host/port here.
self
.
orig_prefix
=
get_script_prefix
()
if
not
(
self
.
orig_prefix
.
startswith
(
'http:'
)
or
self
.
orig_prefix
.
startswith
(
'https:'
)):
prefix
=
'
%
s://
%
s'
%
(
request
.
is_secure
()
and
'https'
or
'http'
,
request
.
get_host
())
set_script_prefix
(
prefix
+
self
.
orig_prefix
)
def
final
(
self
,
request
,
response
,
*
args
,
**
kargs
):
def
final
(
self
,
request
,
response
,
*
args
,
**
kargs
):
"""
"""
Hook for any code that needs to run after everything else in the view.
Hook for any code that needs to run after everything else in the view.
"""
"""
# Restore script_prefix.
set_script_prefix
(
self
.
orig_prefix
)
# Always add these headers.
# Always add these headers.
response
.
headers
[
'Allow'
]
=
', '
.
join
(
self
.
allowed_methods
)
response
.
headers
[
'Allow'
]
=
', '
.
join
(
self
.
allowed_methods
)
# sample to allow caching using Vary http header
# sample to allow caching using Vary http header
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment