Skip to content

Commit

Permalink
fix: Allow encoded path parameters with slashes (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtfpessoa authored Aug 10, 2021
1 parent fba0a14 commit b35b144
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion routers/gorillamux/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func NewRouter(doc *openapi3.T) (routers.Router, error) {
if len(servers) == 0 {
servers = append(servers, srv{})
}
muxRouter := mux.NewRouter() /*.UseEncodedPath()?*/
muxRouter := mux.NewRouter().UseEncodedPath()
r := &Router{}
for _, path := range orderedPaths(doc.Paths) {
pathItem := doc.Paths[path]
Expand Down
2 changes: 1 addition & 1 deletion routers/gorillamux/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func TestRouter(t *testing.T) {
expect(r, http.MethodGet, "/params/a/b/c%2Fd", paramsGET, map[string]string{
"x": "a",
"y": "b",
"z": "c/d",
"z": "c%2Fd",
})
expect(r, http.MethodGet, "/books/War.and.Peace", paramsGET, map[string]string{
"bookid": "War.and.Peace",
Expand Down

0 comments on commit b35b144

Please sign in to comment.