You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of a coding error, I was trying to make a POST request to a go webserver with the path "//create", instead of "/create"
Expected Behavior:
The server should give me a 404 or 400 error, or pass the request along normally. I'm not convinced that "//foo" is a valid path, but if it isn't the server should return an error rather then mangling the request passed to the handler.
Actual Behavior:
The Go server decided to claim that the request was a GET request with no content. Attached is a go server that exhibits this bug along with python code to make the strange request.
Go response with 301:
HTTP/1.1 301 Moved Permanently
Location: /foo
Date: Wed, 02 Sep 2015 18:07:41 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8
requests resend the request as a GET:
GET /foo HTTP/1.1
Host: localhost:8081
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: /
User-Agent: python-requests/2.7.0 CPython/2.7.10 Linux/2.6
And this is what the Go handler gets, and it responses with:
HTTP/1.1 200 OK
Date: Wed, 02 Sep 2015 18:07:41 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8
What I did:
Because of a coding error, I was trying to make a POST request to a go webserver with the path "//create", instead of "/create"
Expected Behavior:
The server should give me a 404 or 400 error, or pass the request along normally. I'm not convinced that "//foo" is a valid path, but if it isn't the server should return an error rather then mangling the request passed to the handler.
Actual Behavior:
The Go server decided to claim that the request was a GET request with no content. Attached is a go server that exhibits this bug along with python code to make the strange request.
Python request script
Go Server
The output I get from the go script is the following
I'm using go 1.4.2 windows/amd64
The text was updated successfully, but these errors were encountered: