Skip to content

Instantly share code, notes, and snippets.

@denik
Created May 21, 2013 16:14
Show Gist options
  • Save denik/5621051 to your computer and use it in GitHub Desktop.
Save denik/5621051 to your computer and use it in GitHub Desktop.
gevent.wsgi extension that adds RAW_REQUEST variable to environ which contains original HTTP request as passed by the client.
from gevent.wsgi import WSGIHandler as _WSGIHandler, WSGIServer as _WSGIServer
class WSGIHandler(_WSGIHandler):
format_request = format_request
def get_environ(self):
environ = _WSGIHandler.get_environ(self)
environ['RAW_REQUEST'] = self.path
return environ
class WSGIServer(_WSGIServer):
handler_class = WSGIHandler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment