[ch33079] Fixed the route parser
This commit is contained in:
parent
3c33e95efd
commit
ccb3bfa385
|
@ -81,7 +81,9 @@ func (r Router) Invoke(ctx context.Context, payload []byte) ([]byte, error) {
|
|||
path := req.Path
|
||||
|
||||
for param, value := range req.PathParameters {
|
||||
path = strings.Replace(path, value, "{"+param+"}", -1)
|
||||
oldValue := fmt.Sprintf("/%s/", value)
|
||||
newValue := fmt.Sprintf("/{%s}/", param)
|
||||
path = strings.Replace(path, oldValue, newValue, -1)
|
||||
}
|
||||
|
||||
i, found := r.events.Get([]byte(req.HTTPMethod + path))
|
||||
|
|
Loading…
Reference in New Issue