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

https://<api_host>/graphql results in 307 redirect to http #931

Closed
liqwid opened this issue Sep 20, 2022 · 3 comments
Closed

https://<api_host>/graphql results in 307 redirect to http #931

liqwid opened this issue Sep 20, 2022 · 3 comments
Assignees
Labels
question Further information is requested
Milestone

Comments

@liqwid
Copy link

liqwid commented Sep 20, 2022

Context

When using https://<api_host>/graphql endpoint instead of https://<api_host>/graphql/ Ariadne sends a 307 redirect to the trailing-slash one.

Expected behavior

Initial scheme (http or https) should be respected in the redirect

Actual behavior

You get always redirected to http which in turn results in browser Mixed Content error (e.g. in Chrome 105.0.5195.125+)

@rafalp
Copy link
Contributor

rafalp commented Sep 20, 2022

Ariadne is not implementing any router that would check the URL and make such redirect. Are you mounting it under FastAPI or Starlette?

@rafalp rafalp added the question Further information is requested label Sep 20, 2022
@liqwid
Copy link
Author

liqwid commented Oct 7, 2022

Mounting under FastAPI, sorry for the delay

@rafalp
Copy link
Contributor

rafalp commented Oct 7, 2022

This is behaviour of Starlette's router that FastAPI also uses. Your usecase is even explicitly mentioned here:

encode/starlette#869

@rafalp rafalp closed this as completed Oct 7, 2022
@rafalp rafalp added this to the Ariadne 0.17 milestone Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants