-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http/client.py does not print correct headers in debug #77546
Comments
Consider the following script: try: handler = request.HTTPSHandler(debuglevel=1)
opener = request.build_opener(handler)
f = opener.open('https://httpbin.org/user-agent') In python2.x this works: $ python2 http_client_bug.py
send: 'GET /user-agent HTTP/1.1\r\nAccept-Encoding: identity\r\nHost:
httpbin.org\r\nConnection: close\r\nUser-Agent: Python-urllib/2.7\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Connection: close
header: Server: gunicorn/19.7.1
header: Date: Thu, 26 Apr 2018 12:01:35 GMT
header: Content-Type: application/json
header: Access-Control-Allow-Origin: *
header: Access-Control-Allow-Credentials: true
header: X-Powered-By: Flask
header: X-Processed-Time: 0
header: Content-Length: 40
header: Via: 1.1 vegur But in python3.x only the header keys are printed. Not the values (also a newline after each header will be nice): $ python3 http_client_bug.py
send: b'GET /user-agent HTTP/1.1\r\nAccept-Encoding: identity\r\nHost:
httpbin.org\r\nUser-Agent: Python-urllib/3.6\r\nConnection: close\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Connection header: Server header: Date header: Content-Type
header: Access-Control-Allow-Origin header:
Access-Control-Allow-Credentials header: X-Powered-By header:
X-Processed-Time header: Content-Length header: Patch for this is attached. |
lethliel
mannequin
added
3.7 (EOL)
end of life
3.8 (EOL)
end of life
stdlib
Python modules in the Lib dir
labels
Apr 26, 2018
Thank you for your contribution Marco! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: