-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Labels
type: enhancementNew feature or requestNew feature or request
Description
Description
The clutch HTTP muxer checks that gRPC gateway URLs are rooted at the path /v[0-9]+.
clutch/backend/gateway/mux/mux.go
Lines 38 to 39 in 0aa0f85
| var apiPattern = regexp.MustCompile(`^/v\d+/`) | |
clutch/backend/gateway/mux/mux.go
Lines 59 to 63 in 0aa0f85
| if apiPattern.MatchString(r.URL.Path) || r.URL.Path == "/healthcheck" { | |
| // Serve from the embedded API handler. | |
| a.next.ServeHTTP(w, r) | |
| return | |
| } |
This is a trap for young players, and it took me a while to figure out why clutch served a 500 when I used an initial path component of /foo. It would be best if clutch enforced this constraint by inspecting the protobuf types at startup, but otherwise it would be nice to emphasize this in the docs.
Metadata
Metadata
Assignees
Labels
type: enhancementNew feature or requestNew feature or request