From 552e60440c7e4031af523f3705cd20c102a3f6f7 Mon Sep 17 00:00:00 2001 From: foxixus Date: Thu, 14 Aug 2025 13:36:22 +0000 Subject: [PATCH] Bug fix --- pkg/handlers/docs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/handlers/docs.go b/pkg/handlers/docs.go index 53523a6..38c1d0c 100644 --- a/pkg/handlers/docs.go +++ b/pkg/handlers/docs.go @@ -37,11 +37,11 @@ func (h *DocsHandler) GetOpenAPISpec(w http.ResponseWriter, r *http.Request) { } func (h *DocsHandler) ServeDocs(w http.ResponseWriter, r *http.Request) { - _ = determineBaseURL(r) + baseURL := determineBaseURL(r) - // Use relative SpecURL so the browser automatically uses the current origin and protocol + // Use absolute SpecURL so the library does not try to read a local file path htmlContent, err := scalar.ApiReferenceHTML(&scalar.Options{ - SpecURL: "/openapi.json", + SpecURL: fmt.Sprintf("%s/openapi.json", baseURL), CustomOptions: scalar.CustomOptions{ PageTitle: "Neo Movies API Documentation", },