Skip to content

Commit

Permalink
fix: Properly parse url in oauth callback
Browse files Browse the repository at this point in the history
  • Loading branch information
reidlevesque committed Jul 31, 2024
1 parent 5602047 commit b2ff3d6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package echoSwagger
import (
"html/template"
"net/http"
"net/url"
"path/filepath"
"regexp"

Expand Down Expand Up @@ -188,7 +189,13 @@ func EchoWrapHandler(options ...func(*Config)) echo.HandlerFunc {
}
_, _ = c.Response().Writer.Write(doc)
default:
c.Request().URL.Path = matches[2]
parsedUrl, err := url.Parse(matches[2])
if err != nil {
c.Error(err)

return nil
}
c.Request().URL = parsedUrl
http.FileServer(http.FS(swaggerFiles.FS)).ServeHTTP(c.Response(), c.Request())
}

Expand Down

0 comments on commit b2ff3d6

Please sign in to comment.