Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing slashes in URLs #1

Open
hroncok opened this issue Jun 29, 2017 · 2 comments
Open

Trailing slashes in URLs #1

hroncok opened this issue Jun 29, 2017 · 2 comments

Comments

@hroncok
Copy link

hroncok commented Jun 29, 2017

Some of the routes here use a trailing slash, such as /ws/healthz/, some don't, such as /ws/data/all. Since you are using flask, the redirect from /ws/healthz to /ws/healthz/ Just Works™, while not the other way around. Using routes with trailing slashes everywhere might be less confusing.

See the Unique URLs / Redirection Behavior in Flask Quickstart.

@jorgemoralespou
Copy link
Contributor

@GrahamDumpleton Can you look into this?

@GrahamDumpleton
Copy link
Contributor

I suspect we have to be careful about using/requiring trailing slashes in routes for code for those with three path elements as we need to maintain equivalence with how the Java version of the back end service worked originally.

The trailing slash redirection may well work for the back end service, but the front end client which has the path fixed, and which needs to still work with Java back end service types, possibly isn't going to handle the redirection. We can't change the front end client to use a trailing slash instead as the Java back ends can't handle trailing slash for three element path versions of URL that I remember, yet require the trailing slash for the two element path versions.

I don't know if there is a difference, but that documentation about redirection behaviour is also for Flask itself. Does that still apply for Flask-Restful, which is what we use as a layer on top?

Anyway, the important thing is we need to work the same as how Java back end services worked and they don't handle lack of trailing slashes the same.

I will leave this here to look at next time am working on the apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants