(first 1.0 release, release date to be announced)
+ 1.0 release, release date to be announced)
- improved func:`url_decode` and :func:`url_encode` performance.
- fixed an issue where the SharedDataMiddleware could cause an
generated component contains a colon.
- :func:`werkzeug.import_string` now works with partially set up
+- disabled automatic socket swiching for IPv6 on the development
+ server due to problems it caused.
+- Werkzeug no longer overrides the Date header when creating a
+ conditional HTTP response.
response.headers['Content-Length'] = len(response.data)
assert response.headers['Cache-Control'] == 'must-revalidate, max-age=60'
+ assert 'date' not in response.headers
+ assert 'date' in response.headers
# after the thing is invoked by the server as wsgi application
# (we're emulating this here), there must not be any entity
assert resp.status_code == 304
assert not 'content-length' in resp.headers
+ # make sure date is not overriden
+ response = Response('Hello World')
+ assert response.date == d
"""Freeze of the etag response mixin adds etag if mixed first"""
def select_ip_version(host, port):
"""Returns AF_INET4 or AF_INET6 depending on where to connect to."""
- info = socket.getaddrinfo(host, port, socket.AF_UNSPEC,
- except socket.gaierror:
+ # disabled due to problems with current ipv6 implementations
+ # and various operating systems. Probably this code also is
+ # not supposed to work, but I can't come up with any other
+ # ways to implement this.
+ ## info = socket.getaddrinfo(host, port, socket.AF_UNSPEC,
+ ## socket.SOCK_STREAM, 0,
+ ##except socket.gaierror:
if ':' in host and hasattr(socket, 'AF_INET6'):
environ = _get_environ(request_or_environ)
if environ['REQUEST_METHOD'] in ('GET', 'HEAD'):
- self.headers['Date'] = http_date()
+ # if the date is not in the headers, add it now. We however
+ # will not override an already existing header. Unfortunately
+ # will this header be overriden by many WSGI servers including
+ if 'date' not in self.headers:
+ self.headers['Date'] = http_date()
if 'content-length' in self.headers:
self.headers['Content-Length'] = len(self.data)
if not is_resource_modified(environ, self.headers.get('etag'), None,