python-hyper / hyper

HTTP/2 for Python.
http://hyper.rtfd.org/en/latest/
MIT License
1.05k stars 192 forks source link

HTTPUpgrade is not working #281

Open hansroh opened 8 years ago

hansroh commented 8 years ago

In common.connection.HTTPConnection.get_response (), there is no creating new request.

I think it should be added 3 or 4 lines:

def request(self, method, url, body=None, headers=None):

    +self._last_requested_args = (method, url, body, headers)
    ...

def get_response (self):

  ...
  self._conn._connect_upgrade(e.sock)

  +stream_id = self._conn.request (*self._last_requested_args)
  +return self._conn.get_response (stream_id)
Lukasa commented 8 years ago

We shouldn't need to create a new request: the _connect_upgrade should be sufficient. What problem are you bumping into exactly? Can you provide a traceback, please?

hansroh commented 8 years ago

Sorry, I misunderstood protocol specification. Your comment is very helpful to me enabling HTTP/2 on my server program. Thank you.