mirror of
https://github.com/openfaas/faas.git
synced 2025-06-13 10:46:46 +00:00
Deprecate routeless proxy test
Routeless proxy allowed no HTTP path to be given when a Header X-Function: name was given. This has been deprecated - I am unaware of any usage of the feature. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
parent
5e0569f75a
commit
daa79aef75
@ -115,8 +115,6 @@ func main() {
|
|||||||
|
|
||||||
r.PathPrefix("/ui/").Handler(http.StripPrefix("/ui", fsCORS)).Methods(http.MethodGet)
|
r.PathPrefix("/ui/").Handler(http.StripPrefix("/ui", fsCORS)).Methods(http.MethodGet)
|
||||||
|
|
||||||
r.HandleFunc("/", faasHandlers.RoutelessProxy).Methods(http.MethodPost)
|
|
||||||
|
|
||||||
metricsHandler := metrics.PrometheusHandler()
|
metricsHandler := metrics.PrometheusHandler()
|
||||||
r.Handle("/metrics", metricsHandler)
|
r.Handle("/metrics", metricsHandler)
|
||||||
r.Handle("/", http.RedirectHandler("/ui/", http.StatusMovedPermanently)).Methods(http.MethodGet)
|
r.Handle("/", http.RedirectHandler("/ui/", http.StatusMovedPermanently)).Methods(http.MethodGet)
|
||||||
|
@ -100,23 +100,23 @@ func TestEchoIt_Post_Route_Handler(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestEchoIt_Post_X_Header_Routing_Handler(t *testing.T) {
|
// Test suppressed due to X-Header deprecation.
|
||||||
reqBody := "test message"
|
// func TestEchoIt_Post_X_Header_Routing_Handler(t *testing.T) {
|
||||||
headers := make(map[string]string, 0)
|
// reqBody := "test message"
|
||||||
headers["X-Function"] = "func_echoit"
|
// headers := make(map[string]string, 0)
|
||||||
|
// headers["X-Function"] = "func_echoit"
|
||||||
|
|
||||||
body, code, err := fireRequestWithHeaders("http://localhost:8080/", http.MethodPost, reqBody, headers)
|
// body, code, err := fireRequestWithHeaders("http://localhost:8080/", http.MethodPost, reqBody, headers)
|
||||||
|
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
t.Log(err)
|
// t.Log(err)
|
||||||
t.Fail()
|
// t.Fail()
|
||||||
}
|
// }
|
||||||
if code != http.StatusOK {
|
// if code != http.StatusOK {
|
||||||
t.Log("Failed")
|
// t.Logf("statusCode - want: %d, got: %d", http.StatusOK, code)
|
||||||
}
|
// }
|
||||||
if body != reqBody {
|
// if body != reqBody {
|
||||||
t.Log("Expected body returned")
|
// t.Logf("Expected body from echo function to be equal to input, but was: %s", body)
|
||||||
t.Fail()
|
// t.Fail()
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user