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
7d96f0c4
Kaydet (Commit)
7d96f0c4
authored
Şub 07, 2018
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #27795 -- Replaced force_bytes() usage in django.http.
üst
fa75b2cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
request.py
django/http/request.py
+6
-5
response.py
django/http/response.py
+3
-4
No files found.
django/http/request.py
Dosyayı görüntüle @
7d96f0c4
...
...
@@ -14,7 +14,7 @@ from django.core.files import uploadhandler
from
django.http.multipartparser
import
MultiPartParser
,
MultiPartParserError
from
django.utils.datastructures
import
ImmutableList
,
MultiValueDict
from
django.utils.deprecation
import
RemovedInDjango30Warning
from
django.utils.encoding
import
escape_uri_path
,
force_bytes
,
iri_to_uri
from
django.utils.encoding
import
escape_uri_path
,
iri_to_uri
from
django.utils.functional
import
cached_property
from
django.utils.http
import
is_same_domain
,
limited_parse_qsl
...
...
@@ -511,7 +511,7 @@ class QueryDict(MultiValueDict):
"""
output
=
[]
if
safe
:
safe
=
force_bytes
(
safe
,
self
.
encoding
)
safe
=
safe
.
encode
(
self
.
encoding
)
def
encode
(
k
,
v
):
return
'
%
s=
%
s'
%
((
quote
(
k
,
safe
),
quote
(
v
,
safe
)))
...
...
@@ -519,9 +519,10 @@ class QueryDict(MultiValueDict):
def
encode
(
k
,
v
):
return
urlencode
({
k
:
v
})
for
k
,
list_
in
self
.
lists
():
k
=
force_bytes
(
k
,
self
.
encoding
)
output
.
extend
(
encode
(
k
,
force_bytes
(
v
,
self
.
encoding
))
for
v
in
list_
)
output
.
extend
(
encode
(
k
.
encode
(
self
.
encoding
),
v
.
encode
(
self
.
encoding
))
for
v
in
list_
)
return
'&'
.
join
(
output
)
...
...
django/http/response.py
Dosyayı görüntüle @
7d96f0c4
...
...
@@ -13,7 +13,7 @@ from django.core.exceptions import DisallowedRedirect
from
django.core.serializers.json
import
DjangoJSONEncoder
from
django.http.cookie
import
SimpleCookie
from
django.utils
import
timezone
from
django.utils.encoding
import
force_bytes
,
iri_to_uri
from
django.utils.encoding
import
iri_to_uri
from
django.utils.http
import
http_date
_charset_from_content_type_re
=
re
.
compile
(
r';\s*charset=(?P<charset>[^\s;]+)'
,
re
.
I
)
...
...
@@ -228,9 +228,8 @@ class HttpResponseBase:
return
bytes
(
value
)
if
isinstance
(
value
,
str
):
return
bytes
(
value
.
encode
(
self
.
charset
))
# Handle non-string types (#16494)
return
force_bytes
(
value
,
self
.
charset
)
# Handle non-string types.
return
str
(
value
)
.
encode
(
self
.
charset
)
# These methods partially implement the file-like object interface.
# See https://docs.python.org/3/library/io.html#io.IOBase
...
...
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