Skip to content

Commit b09ab2c

Browse files
authored
Merge pull request #3255 from semaphoreui/copilot/fix-3238
Fix blank page when accessing Swagger API docs at /swagger/
2 parents 886bb6c + 131f3bc commit b09ab2c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

api/router.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,13 @@ func servePublic(w http.ResponseWriter, r *http.Request) {
561561
return
562562
}
563563

564+
// Check if this is a request for the swagger UI
565+
swaggerPath := path.Join(webPath, "swagger")
566+
if reqPath == swaggerPath || reqPath == swaggerPath+"/" {
567+
serveFile(w, r, "swagger/index.html")
568+
return
569+
}
570+
564571
if !strings.Contains(reqPath, ".") {
565572
serveFile(w, r, "index.html")
566573
return

0 commit comments

Comments
 (0)