diff --git a/server/http_integration_test.go b/server/http_integration_test.go index 0ccd715d7..e88f5ffcb 100644 --- a/server/http_integration_test.go +++ b/server/http_integration_test.go @@ -192,7 +192,7 @@ func TestHTTPServer_ServeHTTP(t *testing.T) { }, { testRequest{http.MethodGet, "http://anyserver:8080/app"}, - expectation{http.StatusInternalServerError, []byte("configuration error\n"), http.Header{"Couper-Error": {"configuration error"}}, ""}, + expectation{http.StatusNotFound, []byte("route not found error\n"), http.Header{"Couper-Error": {"route not found error"}}, ""}, }, }}, {"files/01_couper.hcl", []requestCase{ @@ -212,7 +212,7 @@ func TestHTTPServer_ServeHTTP(t *testing.T) { }, { testRequest{http.MethodGet, "http://couper.io:9898/"}, - expectation{http.StatusInternalServerError, []byte("configuration error\n"), nil, ""}, + expectation{http.StatusNotFound, []byte("route not found error\n"), http.Header{"Couper-Error": {"route not found error"}}, ""}, }, { testRequest{http.MethodGet, "http://example.com:9898/b"}, @@ -220,7 +220,7 @@ func TestHTTPServer_ServeHTTP(t *testing.T) { }, { testRequest{http.MethodGet, "http://example.com:9898/"}, - expectation{http.StatusInternalServerError, []byte("configuration error\n"), nil, ""}, + expectation{http.StatusNotFound, []byte("route not found error\n"), http.Header{"Couper-Error": {"route not found error"}}, ""}, }, }}, {"files_spa_api/01_couper.hcl", []requestCase{ @@ -236,7 +236,7 @@ func TestHTTPServer_ServeHTTP(t *testing.T) { {"api/01_couper.hcl", []requestCase{ { testRequest{http.MethodGet, "http://anyserver:8080/"}, - expectation{http.StatusInternalServerError, []byte("configuration error\n"), http.Header{"Couper-Error": {"configuration error"}}, ""}, + expectation{http.StatusNotFound, []byte("route not found error\n"), http.Header{"Couper-Error": {"route not found error"}}, ""}, }, { testRequest{http.MethodGet, "http://anyserver:8080/v1"}, @@ -256,13 +256,13 @@ func TestHTTPServer_ServeHTTP(t *testing.T) { }, { testRequest{http.MethodGet, "http://anyserver:8080/v1x"}, - expectation{http.StatusInternalServerError, []byte("configuration error\n"), http.Header{"Content-Type": {"text/html"}}, ""}, + expectation{http.StatusNotFound, []byte("route not found error\n"), http.Header{"Couper-Error": {"route not found error"}}, ""}, }, }}, {"api/02_couper.hcl", []requestCase{ { testRequest{http.MethodGet, "http://anyserver:8080/"}, - expectation{http.StatusInternalServerError, []byte("configuration error\n"), http.Header{"Couper-Error": {"configuration error"}}, ""}, + expectation{http.StatusNotFound, []byte("route not found error\n"), http.Header{"Couper-Error": {"route not found error"}}, ""}, }, { testRequest{http.MethodGet, "http://anyserver:8080/v2/"}, @@ -436,7 +436,7 @@ func TestHTTPServer_HostHeader2(t *testing.T) { _ = res.Body.Close() - if string(resBytes) != "configuration error\n" { + if string(resBytes) != "route not found error\n" { t.Errorf("%s", resBytes) } diff --git a/server/http_test.go b/server/http_test.go index 6ad6d3ba6..87bbbdac1 100644 --- a/server/http_test.go +++ b/server/http_test.go @@ -85,8 +85,8 @@ func TestHTTPServer_ServeHTTP_Files(t *testing.T) { expectedBody []byte expectedStatus int }{ - {"/", []byte("