Cleanup logging, give not allowed to GET on gateway functions

This commit is contained in:
Alex Ellis
2017-04-05 22:34:45 +01:00
parent 469fc690da
commit 3aec97441e
3 changed files with 51 additions and 41 deletions

View File

@ -44,19 +44,19 @@ func fireRequestWithHeaders(url string, method string, reqBody string, headers m
return string(body), res.StatusCode, readErr
}
// TODO: Review this - should give StatusMethodNotAllowed, gives 200 OK
func TestGet_Rejected(t *testing.T) {
// var reqBody string
// _, code, err := fireRequest("http://localhost:8080/function/func_echoit", http.MethodGet, reqBody)
var reqBody string
_, code, err := fireRequest("http://localhost:8080/function/func_echoit", http.MethodGet, reqBody)
want := http.StatusMethodNotAllowed
if code != want {
t.Logf("Failed got: %d, wanted: %d", code, want)
t.Fail()
}
// if code != http.StatusMethodNotAllowed {
// t.Logf("Failed got: %d", code)
// }
// if err != nil {
// t.Log(err)
// t.Fail()
// }
if err != nil {
t.Log(err)
t.Fail()
}
}
func TestEchoIt_Post_Route_Handler_ForwardsClientHeaders(t *testing.T) {