diff --git a/internal/http/handlers/error_page/handler.go b/internal/http/handlers/error_page/handler.go index 74d46ea7..0e6de6bd 100644 --- a/internal/http/handlers/error_page/handler.go +++ b/internal/http/handlers/error_page/handler.go @@ -22,7 +22,7 @@ func New(cfg *config.Config, log *logger.Logger) fasthttp.RequestHandler { //nol code uint16 ) - if fromUrl, okUrl := extractCodeFromURL(string(ctx.RequestURI())); okUrl { + if fromUrl, okUrl := extractCodeFromURL(string(ctx.Path())); okUrl { code = fromUrl } else if fromHeader, okHeaders := extractCodeFromHeaders(reqHeaders); okHeaders { code = fromHeader diff --git a/internal/http/handlers/error_page/handler_test.go b/internal/http/handlers/error_page/handler_test.go index 2bbbbad7..fa1faf33 100644 --- a/internal/http/handlers/error_page/handler_test.go +++ b/internal/http/handlers/error_page/handler_test.go @@ -61,7 +61,7 @@ func TestHandler(t *testing.T) { return &cfg }, - giveUrl: "http://testing/503.html", + giveUrl: "http://testing/503.html?rnd=123", giveHeaders: map[string]string{"Accept": "application/json", "X-FooBar": "baz"}, wantStatusCode: http.StatusServiceUnavailable, diff --git a/internal/http/server.go b/internal/http/server.go index 82b4aa04..7b1df00e 100644 --- a/internal/http/server.go +++ b/internal/http/server.go @@ -62,7 +62,7 @@ func (s *Server) Register(cfg *config.Config) error { ) s.server.Handler = func(ctx *fasthttp.RequestCtx) { - var url, method = string(ctx.RequestURI()), string(ctx.Method()) + var url, method = string(ctx.Path()), string(ctx.Method()) switch { // live endpoints