You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Add CORS headers for /graphql
This commit is contained in:
committed by
Quentin Gliech
parent
a01c53019f
commit
bca3ab5eb6
@ -116,10 +116,23 @@ where
|
||||
Encrypter: FromRef<S>,
|
||||
CookieJar: FromRequestParts<S>,
|
||||
{
|
||||
let mut router = Router::new().route(
|
||||
"/graphql",
|
||||
get(self::graphql::get).post(self::graphql::post),
|
||||
);
|
||||
let mut router = Router::new()
|
||||
.route(
|
||||
"/graphql",
|
||||
get(self::graphql::get).post(self::graphql::post),
|
||||
)
|
||||
.layer(
|
||||
CorsLayer::new()
|
||||
.allow_origin(Any)
|
||||
.allow_methods(Any)
|
||||
.allow_otel_headers([
|
||||
AUTHORIZATION,
|
||||
ACCEPT,
|
||||
ACCEPT_LANGUAGE,
|
||||
CONTENT_LANGUAGE,
|
||||
CONTENT_TYPE,
|
||||
]),
|
||||
);
|
||||
|
||||
if playground {
|
||||
router = router.route("/graphql/playground", get(self::graphql::playground));
|
||||
|
Reference in New Issue
Block a user