Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Add a flag to connection and to response objects to find out connection type. #285

Closed
fendouai opened this issue Sep 28, 2016 · 7 comments
Closed

Comments

@fendouai
Copy link

I can not get the http version from headers,how to get the http version when i use http2.

@Lukasa
Copy link
Member

Lukasa commented Sep 28, 2016

@fendouai If you call type() on the response object you're holding, that will give you the object, which will be either a HTTP20Response or a HTTP11Response. That is enough to know the version.

However, I think we should add a feature that lets you consult a flag.

@Lukasa Lukasa changed the title I can not get the http version from headers,how to get the http version when i use http2. Add a flag to connection and to response objects to find out connection type. Sep 28, 2016
@fendouai
Copy link
Author

Thank you. And I think the flag which shows the version of the http is important.

@nateprewitt
Copy link
Member

Would you like to help contribute a patch for this @fendouai? If not, I'd be willing to pick this up.

@fendouai
Copy link
Author

fendouai commented Sep 28, 2016

I am trying to find the version. I am not familiar with the project yet.If I have a solution,I will try to contribute a patch for this.

@nateprewitt
Copy link
Member

@Lukasa I've had this sitting for a while (9286249). If we still want it, I can open the PR. I wasn't sure if standard practice was truncating ".0" from HTTP/2 or if we even wanted "HTTP" in the version flag.

@Lukasa
Copy link
Member

Lukasa commented Dec 1, 2016

I actually strongly recommend using the enum module and then using an enum to flag this. Let's pretend we're real programmers. ;)

@Lukasa
Copy link
Member

Lukasa commented Dec 7, 2016

Resolved by #296.

@Lukasa Lukasa closed this as completed Dec 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants