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

Redirect middleware not hitting single-entry endpoints #174

Closed
CasperWA opened this issue Feb 10, 2020 · 4 comments
Closed

Redirect middleware not hitting single-entry endpoints #174

CasperWA opened this issue Feb 10, 2020 · 4 comments
Labels
bug Something isn't working priority/medium Issue or PR with a consensus of medium priority

Comments

@CasperWA
Copy link
Member

With the addition of the human-readable landing page, the redirect middleware was changed to avoid infinite loops on the base URLs.
This also means that single-entry endpoints are no longer redirected from /endpoint/id/ to /endpoint/id.

@CasperWA CasperWA added bug Something isn't working priority/medium Issue or PR with a consensus of medium priority labels Feb 10, 2020
@ml-evs
Copy link
Member

ml-evs commented Feb 10, 2020

I don't think this is an issue (https://optimade.herokuapp.com/optimade/v0/structures/mpf_1/ redirects fine for me); the problem was that the slashed endpoints e.g. /structures/ had a defined response (i.e. query structure endpoint with a blank ID) but in this case the matching response is still just return the single entry endpoint.

Do you have a counterexample where it doesn't work?

@CasperWA
Copy link
Member Author

It must be a thing of heroku then, starting the server locally and going to http://localhost:5000/optimade/v0/structures/mpf_1/ renders the implementation in a state where it tries to find id mpf_1/ (I believe) so it doesn't work - but maybe that is actually the desired result? Since / should be allowed in the id, right?

@CasperWA
Copy link
Member Author

I think we should close this, since it is not desired to have the final / removed for single-entry endpoints as / is a valid character for ids.

@CasperWA
Copy link
Member Author

Closing this, as per my last comment, it is not desired to have the final / (forward slash) removed for single-entry endpoints, as the slash may be part of the id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority/medium Issue or PR with a consensus of medium priority
Projects
None yet
Development

No branches or pull requests

2 participants