Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
e2f28572
Kaydet (Commit)
e2f28572
authored
Şub 09, 2014
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #2245 from funkybob/parse_header
Replaced _parse_content_type with cgi.parse_header
üst
95ede98e
f43e895b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
16 deletions
+2
-16
wsgi.py
django/core/handlers/wsgi.py
+2
-16
No files found.
django/core/handlers/wsgi.py
Dosyayı görüntüle @
e2f28572
from
__future__
import
unicode_literals
import
cgi
import
codecs
import
logging
import
sys
...
...
@@ -95,7 +96,7 @@ class WSGIRequest(http.HttpRequest):
self
.
META
[
'PATH_INFO'
]
=
path_info
self
.
META
[
'SCRIPT_NAME'
]
=
script_name
self
.
method
=
environ
[
'REQUEST_METHOD'
]
.
upper
()
_
,
content_params
=
self
.
_parse_content_type
(
environ
.
get
(
'CONTENT_TYPE'
,
''
))
_
,
content_params
=
cgi
.
parse_header
(
environ
.
get
(
'CONTENT_TYPE'
,
''
))
if
'charset'
in
content_params
:
try
:
codecs
.
lookup
(
content_params
[
'charset'
])
...
...
@@ -115,21 +116,6 @@ class WSGIRequest(http.HttpRequest):
def
_get_scheme
(
self
):
return
self
.
environ
.
get
(
'wsgi.url_scheme'
)
def
_parse_content_type
(
self
,
ctype
):
"""
Media Types parsing according to RFC 2616, section 3.7.
Returns the data type and parameters. For example:
Input: "text/plain; charset=iso-8859-1"
Output: ('text/plain', {'charset': 'iso-8859-1'})
"""
content_type
,
_
,
params
=
ctype
.
partition
(
';'
)
content_params
=
{}
for
parameter
in
params
.
split
(
';'
):
k
,
_
,
v
=
parameter
.
strip
()
.
partition
(
'='
)
content_params
[
k
]
=
v
return
content_type
,
content_params
def
_get_request
(
self
):
warnings
.
warn
(
'`request.REQUEST` is deprecated, use `request.GET` or '
'`request.POST` instead.'
,
PendingDeprecationWarning
,
2
)
...
...
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