Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
217ac595
Commit
217ac595
authored
Jul 09, 2013
by
Ilias Tsitsimpis
Committed by
Christos Stavrakakis
Sep 24, 2013
Browse files
wheezy: is_hop_by_hop has been removed from Django
Implement our own is_hop_by_hop function.
parent
34c783c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-django-lib/snf_django/lib/api/proxy/utils.py
View file @
217ac595
...
...
@@ -31,7 +31,19 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from
django.core.servers.basehttp
import
is_hop_by_hop
try
:
from
django.core.servers.basehttp
import
is_hop_by_hop
except
ImportError
:
# Removed in Django 1.4
_hop_headers
=
{
'connection'
:
1
,
'keep-alive'
:
1
,
'proxy-authenticate'
:
1
,
'proxy-authorization'
:
1
,
'te'
:
1
,
'trailers'
:
1
,
'transfer-encoding'
:
1
,
'upgrade'
:
1
}
def
is_hop_by_hop
(
header_name
):
"""Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header"""
return
header_name
.
lower
()
in
_hop_headers
def
fix_header
(
k
,
v
):
...
...
@@ -43,4 +55,4 @@ def fix_header(k, v):
def
forward_header
(
k
):
return
k
.
upper
()
not
in
[
'HOST'
,
'CONTENT_LENGTH'
,
'CONTENT_TYPE'
]
and
\
not
is_hop_by_hop
(
k
)
and
not
'.'
in
k
not
is_hop_by_hop
(
k
)
and
not
'.'
in
k
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