We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea2d4e1 commit 923e9c6Copy full SHA for 923e9c6
1 file changed
server/rest/rest.go
@@ -53,11 +53,8 @@ func NewServer(graphqlHandler http.Handler) (http.Handler, error) {
53
54
// Redirect root to OpenAPI documentation
55
r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
56
- // Get the base path from the request URL
57
- basePath := strings.TrimSuffix(r.URL.Path, "/")
58
- // When path is "/", basePath will be empty, which is correct for root
59
- redirectPath := basePath + "/openapi.json"
60
- http.Redirect(w, r, redirectPath, http.StatusMovedPermanently)
+ cfg := model.ForContext(r.Context())
+ http.Redirect(w, r, cfg.RestPrefix+"/openapi.json", http.StatusMovedPermanently)
61
})
62
63
// OpenAPI Schema endpoint
0 commit comments