summaryrefslogtreecommitdiff
path: root/wsgitools/authentication.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2012-06-28 22:38:28 +0200
committerHelmut Grohne <helmut@subdivi.de>2012-06-28 22:38:28 +0200
commit7e2e9173b2afcc2a8dca9e6047d0b82ad70c9dff (patch)
treea44f625d4621348ae14a63f72aad1594cd794ed8 /wsgitools/authentication.py
parentb83f5682c9d81cd53b8b45a6baedc844a68b85d2 (diff)
downloadwsgitools-7e2e9173b2afcc2a8dca9e6047d0b82ad70c9dff.tar.gz
first part of bytes conversion
Convert the request body data from str to bytes. This replaces all StringIOs with BytesIOs (removing backwards one more backwards compatibility). Also all character sequences involved in request bodies get a b"" prefix. The StaticContent application takes bytes instead of str (no difference for py2x). The GzipWSGIFilter needs a fixed as a truncate of a BytesIO does not rewind the stream position.
Diffstat (limited to 'wsgitools/authentication.py')
-rw-r--r--wsgitools/authentication.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wsgitools/authentication.py b/wsgitools/authentication.py
index 963dc00..c076d7f 100644
--- a/wsgitools/authentication.py
+++ b/wsgitools/authentication.py
@@ -97,8 +97,8 @@ class AuthenticationMiddleware:
@param exception: reason for the authentication failure
"""
status = "401 Authorization required"
- html = "<html><head><title>401 Authorization required</title></head>" \
- "<body><h1>401 Authorization required</h1></body></html>"
+ html = b"<html><head><title>401 Authorization required</title></head>" \
+ b"<body><h1>401 Authorization required</h1></body></html>"
headers = [("Content-Type", "text/html"),
self.www_authenticate(exception),
("Content-Length", str(len(html)))]