Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always send bodies for 412 responses #1255

Merged
merged 2 commits into from May 22, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

Always send bodies for 412 responses

  • Loading branch information...
mitsuhiko authored and davidism committed Feb 19, 2018
commit 59e3497e8bc592edd27a27cdb754951ad11633c2
@@ -597,7 +597,8 @@ def test_etag_response_412():
# headers left and the status code would have to be 412
resp = wrappers.Response.from_app(response, env)
assert resp.status_code == 412
assert 'content-length' not in resp.headers
# Make sure there is a body still
assert resp.data != b''

# make sure date is not overriden
response = wrappers.Response('Hello World')
@@ -1251,7 +1251,7 @@ def get_wsgi_headers(self, environ):
# Per section 3.3.2 of RFC 7230, "a server MUST NOT send a Content-Length header field
# in any response with a status code of 1xx (Informational) or 204 (No Content)."
headers.remove('Content-Length')
elif status in (304, 412):
elif status == 304:
remove_entity_headers(headers)

# if we can determine the content length automatically, we
@@ -1291,7 +1291,7 @@ def get_app_iter(self, environ):
"""
status = self.status_code
if environ['REQUEST_METHOD'] == 'HEAD' or \
100 <= status < 200 or status in (204, 304, 412):
100 <= status < 200 or status in (204, 304):
iterable = ()
elif self.direct_passthrough:
if __debug__:
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.