diff options
author | jaraco <none@none> | 2009-03-30 22:46:19 +0000 |
---|---|---|
committer | jaraco <none@none> | 2009-03-30 22:46:19 +0000 |
commit | 924734a81e56de0db8c0db84fada515f28d7c1b9 (patch) | |
tree | 9e47b9c2050d745d6b4fdd7fef6a9232eeaf1c78 /cherrypy/lib/encoding.py | |
parent | 11d8e939f92440fa89f6923b7afcd8fb5e01a2f9 (diff) | |
download | cherrypy-git-924734a81e56de0db8c0db84fada515f28d7c1b9.tar.gz |
Moved set_vary_header to cherrypy.lib
Diffstat (limited to 'cherrypy/lib/encoding.py')
-rw-r--r-- | cherrypy/lib/encoding.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/cherrypy/lib/encoding.py b/cherrypy/lib/encoding.py index 410a2dca..4afbbb4e 100644 --- a/cherrypy/lib/encoding.py +++ b/cherrypy/lib/encoding.py @@ -2,7 +2,7 @@ import struct import time import cherrypy - +from cherrypy.lib import set_vary_header def decode(encoding=None, default_encoding='utf-8'): """Decode cherrypy.request.params from str to unicode objects.""" @@ -261,9 +261,3 @@ def gzip(compress_level=5, mime_types=['text/html', 'text/plain']): return cherrypy.HTTPError(406, "identity, gzip").set_response() -def set_vary_header(response, header_name): - varies = response.headers.get("Vary", "") - varies = [x.strip() for x in varies.split(",") if x.strip()] - if header_name not in varies: - varies.append(header_name) - response.headers['Vary'] = ", ".join(varies) |