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

Avoid Sending Regular Content-Length header for "304 Not Modified" responses #2

Open
alanfairless opened this issue Sep 28, 2014 · 1 comment
Assignees
Labels

Comments

@alanfairless
Copy link

This causes web_public_reader to issue a 500 error when running unit test TestModified.test_modification_restriction:

From the web public reader log:

10.0.3.14 - - [2014-02014-09-28 02:53:17,389 INFO     Application         : start request 18269300-e1aa-44bf-b246-e0c980e079ca: 'HEAD' 'http://rr-motoboto-test-01-20140928025317286950.nimbus.io/data/test-key.jpg'
2014-09-28 02:53:17,394 INFO     Application         : request 18269300-e1aa-44bf-b246-e0c980e079ca: head_key: collection = (331) rr-motoboto-test-01-20140928025317286950 key = test-key.jpg None
2014-09-28 02:53:17,403 ERROR    Application         : request 18269300-e1aa-44bf-b246-e0c980e079ca HTTPNotFound Not Found: u'test-key.jpg' head-key 'http://rr-motoboto-test-01-20140928025317286950.nimbus.io/data/test-key.jpg'
2014-09-28 02:53:19,069 INFO     Application         : start request eaa9977c-f43e-4345-a7c4-f15ac9f02710: 'HEAD' 'http://rr-motoboto-test-01-20140928025317286950.nimbus.io/data/test-key.jpg'
2014-09-28 02:53:19,070 INFO     Application         : request eaa9977c-f43e-4345-a7c4-f15ac9f02710: head_key: collection = (331) rr-motoboto-test-01-20140928025317286950 key = test-key.jpg None
2014-09-28 02:53:19,076 INFO     Application         : response to request eaa9977c-f43e-4345-a7c4-f15ac9f02710: dispatch status_int=200 app_iter=True
2014-09-28 02:53:20,170 INFO     Application         : start request 89124d66-0ca2-4673-a56d-db6ea67b4031: 'HEAD' 'http://rr-motoboto-test-01-20140928025317286950.nimbus.io/data/test-key.jpg'
2014-09-28 02:53:20,172 INFO     Application         : request 89124d66-0ca2-4673-a56d-db6ea67b4031: head_key: collection = (331) rr-motoboto-test-01-20140928025317286950 key = test-key.jpg None
2014-09-28 02:53:20,188 INFO     Application         : response to request 89124d66-0ca2-4673-a56d-db6ea67b4031: dispatch status_int=200 app_iter=True
2014-09-28 02:53:20,271 INFO     Application         : start request d67e1520-be33-4d23-be59-3ebec0b05f35: 'HEAD' 'http://rr-motoboto-test-01-20140928025317286950.nimbus.io/data/test-key.jpg'
2014-09-28 02:53:20,274 INFO     Application         : request d67e1520-be33-4d23-be59-3ebec0b05f35: head_key: collection = (331) rr-motoboto-test-01-20140928025317286950 key = test-key.jpg None
2014-09-28 02:53:20,283 INFO     Application         : response to request d67e1520-be33-4d23-be59-3ebec0b05f35: dispatch status_int=304 app_iter=True
Traceback (most recent call last):
  File "gevent/pywsgi.py", line 508, in handle_one_response
    self.run_application()
  File "gevent/pywsgi.py", line 494, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "webob/response.py", line 939, in __call__
    start_response(self.status, headerlist)
  File "gevent/pywsgi.py", line 458, in start_response
    raise AssertionError(msg)
AssertionError: Invalid Content-Length for 304 response: '1048576' (must be absent or zero)
{'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT_ENCODING': 'identity',
 'HTTP_AGENT': 'lumberyard/1.0',
 'HTTP_AUTHORIZATION': 'NIMBUS.IO 1:3ab72050b33fc8ec55900cef4e844580943d4fac9fc7ac48057733bfaeb23c55',
 'HTTP_HOST': 'rr-motoboto-test-01-20140928025317286950.nimbus.io',
 'HTTP_IF_MODIFIED_SINCE': 'Sun, 28 Sep 2014 02:53:20 GMT',
 'HTTP_USER_AGENT': 'Go 1.1 package http',
 'HTTP_X_FORWARDED_FOR': '10.0.3.6:47818',
 'HTTP_X_NIMBUS_IO_TIMESTAMP': '1411872800',
 'HTTP_X_NIMBUS_IO_USER_REQUEST_ID': 'd67e1520-be33-4d23-be59-3ebec0b05f35',
 'PATH_INFO': '/data/test-key.jpg',
 'QUERY_STRING': '', 
 'REMOTE_ADDR': '10.0.3.14',
 'REMOTE_PORT': '40669',
 'REQUEST_METHOD': 'HEAD',
 'SCRIPT_NAME': '', 
 'SERVER_NAME': 'sim-ash10',
 'SERVER_PORT': '9000',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'gevent/1.0 Python/2.7',
 'webob._parsed_query_vars': (GET([]), ''),
 'webob.adhoc_attrs': {'response': <Response at 0x279eed0 200 OK>},
 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fa4e93bd1e0>,
 'wsgi.input': <gevent.pywsgi.Input object at 0x270ce90>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': False,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)} failed with AssertionError
2014-09-28T02:53:20.29015 

@dougfort dougfort added the bug label Sep 29, 2014
@dougfort dougfort added this to the working milestone Sep 29, 2014
dougfort pushed a commit that referenced this issue Sep 29, 2014
@dougfort
Copy link
Contributor

fc6f590

@dougfort dougfort modified the milestones: review request, working Sep 29, 2014
@dougfort dougfort assigned alanfairless and unassigned dougfort Sep 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants