cjoudrey / gluahttp

gluahttp: an http module for gopher-lua
MIT License
59 stars 23 forks source link

Fix TestRequestNoMethod #12

Closed erikdubbelboer closed 8 years ago

erikdubbelboer commented 8 years ago

This test used to result in:

gluahttp_test.go:352: Expected string
"unsupported protocol scheme \"\"",
got string
"Get : unsupported protocol scheme \"\""
cjoudrey commented 8 years ago

I wonder why this used to pass. Maybe in previous Golang versions it didn't default to the get http method?

erikdubbelboer commented 8 years ago

I have no idea, I just looked all the way back to 1.1 and as far as I can see it has always been that way: https://github.com/golang/go/blob/release-branch.go1.4/src/net/http/request.go#L60

cjoudrey commented 8 years ago

Hmm, that's strange. CI seems to be failing: https://travis-ci.org/cjoudrey/gluahttp/builds/138550063

cjoudrey commented 8 years ago

Interesting, it seems like this changed in Go 1.6.2. Look at this: https://travis-ci.org/cjoudrey/gluahttp/builds/140332409

erikdubbelboer commented 8 years ago

Ok so 1.3 and 1.4 don't include the "Get" and 1.5 and higher do. I guess I can add an assert_contains to fix this for both versions.

The other CI you linked is for another pull request and failes because it doesn't contain this pull request yet.

erikdubbelboer commented 8 years ago

Should be fixed now.

cjoudrey commented 8 years ago

Cool! 👍 Feel free to merge.