Skip to content

Commit

Permalink
compile tracked endpoints logic change to set empty path
Browse files Browse the repository at this point in the history
  • Loading branch information
dencoded authored and buger committed Feb 16, 2018
1 parent a446600 commit 8f6bd5b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,13 @@ func (a APIDefinitionLoader) compileTrackedEndpointPathspathSpec(paths []apidef.
for _, stringSpec := range paths {
newSpec := URLSpec{}
a.generateRegex(stringSpec.Path, &newSpec, stat)

// set Path if it wasn't set
if stringSpec.Path == "" {
// even if it is empty (and regex matches everything) some middlewares expect to be value here
stringSpec.Path = "/"
}

// Extend with method actions
newSpec.TrackEndpoint = stringSpec
urlSpec = append(urlSpec, newSpec)
Expand Down

0 comments on commit 8f6bd5b

Please sign in to comment.