| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
status_code.
|
|
Workaround for http://bugs.python.org/issue20747.
In some corner cases, Python 2 inserts a newline in a header value
despite `maxlinelen` passed in Header constructor.
Thanks Tim Graham for the review.
|
|
|
|
make_bytes() assumed that if the Content-Encoding header is set, then
everything had already been dealt with bytes-wise, but in a streaming
situation this was not necessarily the case.
make_bytes() is only called when necessary when working with a
StreamingHttpResponse iterable, but by that point the middleware has
added the Content-Encoding header and thus make_bytes() tried to call
bytes(value) (and dies). If it had been a normal HttpResponse,
make_bytes() would have been called when the content was set, well
before the middleware set the Content-Encoding header.
This commit removes the special casing when Content-Encoding is set,
allowing unicode strings to be encoded during the iteration before they
are e.g. gzipped. This behaviour was added a long time ago for #4969 and
it doesn't appear to be necessary any more, as everything is correctly
made into bytes at the appropriate places.
Two new tests, to show that supplying non-ASCII characters to a
StreamingHttpResponse works fine normally, and when passed through the
GZip middleware (the latter dies without the change to make_bytes()).
Removes the test with a nonsense Content-Encoding and Unicode input - if
this were to happen, it can still be encoded as bytes fine.
|
|
|
|
|
|
|
|
|
|
http.cookie.
This fix is necessary for Python 3.5 compatibility (refs #23763).
Thanks Berker Peksag for review.
|
|
Added getvalue() to HttpResponse to return the content of the response,
along with a few other methods to partially match io.IOBase.
Thanks Claude Paroz for the suggestion and Nick Sanford for review.
|
|
Thanks to Simon Charette, Aymeric Augustin, and Tim Graham
for reviews and contributions.
|
|
Thanks django at patrickbregman.eu for the report.
|
|
|
|
|
|
Thanks Piotr Kasprzyk for help with the patch.
|
|
encoded responses.
Thanks leahculver for the suggestion and Erik Romijn,
Simon Charette, and Marc Tamlyn for the reviews.
|
|
|
|
Fixed #20187 -- Allowed repeated iteration of HttpResponse.
All this became possible when support for old-style streaming responses was
finally removed.
|
|
|
|
Thanks Raphaël Barrois for the report and the initial patch and
Aymeric Augustin for the review.
|
|
Passed large maxlinelen to email.Header to prevent newlines from being
inserted into value returned by _convert_to_charset
Thanks mjl at laubach.at for the report.
|
|
Thanks epandurski at gmail.com for the report.
|
|
Thanks liangent for the report.
|
|
Should be unneeded with Python 2.7 and up.
Added some unicode_literals along the way.
|
|
This code provided a deprecation path for old-style streaming responses.
Refs #6527, #7581.
|
|
This includes HttpResponse and co. __init__() methods,
django.shortcuts.render_to_response() and the index(), sitemap() sitemap
app views.
|
|
428, 429, 431 and 511
|
|
SuspiciousOperations have been differentiated into subclasses, and
are now logged to a 'django.security.*' logger. SuspiciousOperations
that reach django.core.handlers.base.BaseHandler will now return a 400
instead of a 500.
Thanks to tiwoc for the report, and Carl Meyer and Donald Stufft
for review.
|
|
|
|
Thanks coolRR for the report.
|
|
|
|
Also added stacklevel argument, fixed #18127.
|
|
for Python 2 object model compatibility methods.
|
|
Thanks mrmachine for the review.
|
|
response.content can be accessed many times as desired, and always
returns the same result.
iter(response) works only once and consumes the iterator.
|
|
in HttpResponses instantiated with iterators.
|
|
This commit caused every test that does two or more assertContains to
fail, because of #6527. It also made HttpResponse non-pickleable.
Refs #13222.
|
|
Thanks teepark for the report and grahamd for his insights.
|
|
request.py, response.py and utils.py
|