Permalink
Browse files

Default to wsgi.errors=sys.stderr. Fix totally broken conditional res…

…ponse when if-none-match and etag are both set
  • Loading branch information...
1 parent 182806b commit 942ba2007ad7c64d29921d0a8bba121e04b0d7a3 @ianb ianb committed Aug 16, 2007
Showing with 8 additions and 2 deletions.
  1. +5 −0 tests/test_response.txt
  2. +3 −2 webob/__init__.py
View
@@ -81,6 +81,11 @@ properties:
(['GET', 'PUT'], 'GET, PUT')
>>> res.cache_control
<CacheControl ''>
+ >>> print res.cache_control.max_age
+ None
+ >>> res.cache_control.properties['max-age'] = None
+ >>> print res.cache_control.max_age
+ -1
>>> res.cache_control.max_age = 10
>>> res.cache_control
<CacheControl 'max-age=10'>
View
@@ -1,4 +1,5 @@
from cStringIO import StringIO
+import sys
import cgi
import urllib
import urlparse
@@ -1145,7 +1146,7 @@ def blank(cls, path, environ=None, base_url=None, headers=None):
'wsgi.version': (1, 0),
'wsgi.url_scheme': scheme,
'wsgi.input': StringIO(''),
- 'wsgi.errors': StringIO(),
+ 'wsgi.errors': sys.stderr,
'wsgi.multithread': False,
'wsgi.multiprocess': False,
'wsgi.run_once': False,
@@ -1841,7 +1842,7 @@ def conditional_response_app(self, environ, start_response):
status304 = True
else:
# Even if If-Modified-Since matched, if ETag doesn't then reject it
- status304 = True
+ status304 = False
if status304:
start_response('304 Not Modified', self.headerlist)
return []

0 comments on commit 942ba20

Please sign in to comment.