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

Alias optimade/structures/ to optimade/structure #128

Closed
ml-evs opened this issue Jan 10, 2020 · 3 comments · Fixed by #160
Closed

Alias optimade/structures/ to optimade/structure #128

ml-evs opened this issue Jan 10, 2020 · 3 comments · Fixed by #160
Labels
priority/medium Issue or PR with a consensus of medium priority

Comments

@ml-evs
Copy link
Member

ml-evs commented Jan 10, 2020

It's a minor thing, but I keep getting caught out by the blank response when I go to eg. http://odbx.science/optimade/structures/. Is there any reason why we couldn't redirect the empty query to http://odbx.science/optimade/structures?

@ml-evs ml-evs added the question Further information is requested label Jan 10, 2020
@CasperWA
Copy link
Member

No. Feel free to implement away :)

@CasperWA
Copy link
Member

CasperWA commented Feb 4, 2020

Will keep this issue open, since it would still be nice to have - but is unfortunately not easily implemented at the moment (see conclusion from first attempt at #128).

@CasperWA
Copy link
Member

CasperWA commented Feb 5, 2020

So I have found that the APIRouter class has a parameter redirect_slashes. However, it redirects to a path with a slash ending, i.e. /info -> /info/ - so the opposite of what we want. But I guess we could simply introduce our own redirect of the same kind going the other way.
You can try this yourself if you set the route path to /info/ and start the server, going to /info or /info/ you'll see you're redirected to /info/ always.

@CasperWA CasperWA added priority/medium Issue or PR with a consensus of medium priority and removed question Further information is requested labels Feb 5, 2020
@CasperWA CasperWA changed the title Alias optimade/structures/ to optimade/structure? Alias optimade/structures/ to optimade/structure Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/medium Issue or PR with a consensus of medium priority
Projects
None yet
2 participants