ariadne
ariadne copied to clipboard
`https://<api_host>/graphql` results in 307 redirect to `http`
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+)
Ariadne is not implementing any router that would check the URL and make such redirect. Are you mounting it under FastAPI or Starlette?
Mounting under FastAPI, sorry for the delay
This is behaviour of Starlette's router that FastAPI also uses. Your usecase is even explicitly mentioned here:
https://github.com/encode/starlette/issues/869