Skip to content

Commit

Permalink
Revert "Merge branch 'pr/100': Delete body if response code is 204,20…
Browse files Browse the repository at this point in the history
…5 or 304"

This reverts commit 88b21f7, reversing
changes made to 68ec029.

Looking at this a little more in depth, this change doesn't actually
solve the problem.
  • Loading branch information
digitalresistor committed Apr 14, 2015
1 parent 88b21f7 commit 55ea77d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
10 changes: 0 additions & 10 deletions tests/test_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ def test_set_response_status_str_generic_reason():
assert res.status_code == 299
assert res.status == '299 Success'

def test_set_response_status_204():
# setting the response status to 204 should remove the content_type
req = BaseRequest.blank('/')
res = req.get_response(simple_app)
res.status = 204
assert res.status_code == 204
assert res.status == '204 No Content'
assert res.content_type is None
assert res.content_length is None

def test_set_response_status_code():
req = BaseRequest.blank('/')
res = req.get_response(simple_app)
Expand Down
6 changes: 0 additions & 6 deletions webob/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,6 @@ def _status_code__set(self, code):
self._status = '%d %s' % (code, status_reasons[code])
except KeyError:
self._status = '%d %s' % (code, status_generic_reasons[code // 100])
# responses with status == 204 must not include a message body,
# so probably should not have a Content-Type header as well.
# this mimics the "empty_body = True" behavior from webob.exc
if code in [204, 205, 304]:
del self.content_type
del self.content_length

status_code = status_int = property(_status_code__get, _status_code__set,
doc=_status_code__get.__doc__)
Expand Down

0 comments on commit 55ea77d

Please sign in to comment.