estuary
estuary copied to clipboard
Ignore trailing slash on API endpoints
Closes #438
This change will strip the trailing slash from any incoming request. The caller can either make a request with or without it (ex, http://localhost:3004/health
or http://localhost:3004/health/
), both will work now.
@jcace please change the destination branch to dev, and also apply this middle to this echo instance https://github.com/application-research/estuary/blob/master/cmd/estuary-shuttle/main.go#L1050
Thanks @en0ma , made those changes!
This impacts collections
api. collections
api uses a trailing slash to work. Without these, it'll return 404 and can impact the current users.
This impacts
collections
api.collections
api uses a trailing slash to work. Without these, it'll return 404 and can impact the current users.
why does it need a trailing slash?
This impacts
collections
api.collections
api uses a trailing slash to work. Without these, it'll return 404 and can impact the current users.
I modified it here - removed the "/" at the root of the collections
endpoint, and tested it out locally. It seemed to work with both a trailing / and without one
It doesn’t need a trailing hash but as it stands today, it requires a trailing hash. We need to make it backward compatible and communicate these changes to the existing users.
@alvin-reyes do you still have concerns around this? i dont think this is a break since the PR makes both options work (with or without trailing slash). can also ask @anjor to do a quick test since he's probably the collections API's biggest power user right now.
Fixed merge conflicts - let me know if any other concerns guys