Under Review
Last Updated: 05 Jun 2018 05:00 by Eric
Imported User
Created on: 01 Jun 2018 11:46
Type: Feature Request
1
400 Bad Request
code

#!/usr/bin/env python3
from urllib.request import urlopen

# with fiddler open
# no problem, see the slash
resp = urlopen("http://www.baidu.com/")

# with fiddler open
# raises 400 Bad Request
resp = urlopen("http://www.baidu.com")


# with fiddler close
# no problem
resp = urlopen("http://www.baidu.com")

wireshark

see wireshark.png

EXTRA

v5.0.20181.14850 for .NET 4.6.1
64-bit AMD64, VM: 47.0mb, WS: 87.0mb
.NET 4.6.2 WinNT 10.0.17134.0
1 comment
Eric
Posted on: 05 Jun 2018 05:00
In Fiddler, you should have received a HTTP protocol warning noting that URLs require a trailing slash after the hostname (meaning, a non-empty path component). Per the HTTP specification, clients should be adding such a slash (Python apparently does not) and servers absolutely need to be treating such requests equivalently whether the slash is present or not.