estuary icon indicating copy to clipboard operation
estuary copied to clipboard

Ignore trailing slash on API endpoints

Open jcace opened this issue 2 years ago • 1 comments

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 avatar Sep 20 '22 23:09 jcace

@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

en0ma avatar Sep 23 '22 14:09 en0ma

Thanks @en0ma , made those changes!

jcace avatar Sep 26 '22 00:09 jcace

This impacts collections api. collections api uses a trailing slash to work. Without these, it'll return 404 and can impact the current users.

alvin-reyes avatar Sep 26 '22 17:09 alvin-reyes

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?

en0ma avatar Sep 26 '22 18:09 en0ma

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

jcace avatar Sep 26 '22 19:09 jcace

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 avatar Sep 27 '22 01:09 alvin-reyes

@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.

neelvirdy avatar Nov 22 '22 18:11 neelvirdy

Fixed merge conflicts - let me know if any other concerns guys

jcace avatar Nov 22 '22 19:11 jcace