diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py index fe7394f8..0c8f4954 100644 --- a/gunicorn/http/message.py +++ b/gunicorn/http/message.py @@ -173,9 +173,9 @@ class Request(Message): else: self.host = self.host.rsplit(":", 1)[0] self.port = parts.port - self.path = parts.path or None - self.query = parts.query or None - self.fragment = parts.fragment or None + self.path = parts.path or "" + self.query = parts.query or "" + self.fragment = parts.fragment or "" # Version match = self.versre.match(bits[2]) diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py index c954720f..63054597 100644 --- a/gunicorn/http/wsgi.py +++ b/gunicorn/http/wsgi.py @@ -93,7 +93,7 @@ def create(req, sock, client, server, debug=False): "SERVER_SOFTWARE": SERVER_VERSION, "REQUEST_METHOD": req.method, "PATH_INFO": unquote(path_info), - "QUERY_STRING": req.query or '', + "QUERY_STRING": req.query, "RAW_URI": req.path, "CONTENT_TYPE": content_type, "CONTENT_LENGTH": content_length,