mirror of
				https://github.com/mitchell/lambdarouter.git
				synced 2025-10-26 12:05:27 +00:00 
			
		
		
		
	[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 a new issue