You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-07 17:03:01 +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>,
|
Encrypter: FromRef<S>,
|
||||||
CookieJar: FromRequestParts<S>,
|
CookieJar: FromRequestParts<S>,
|
||||||
{
|
{
|
||||||
let mut router = Router::new().route(
|
let mut router = Router::new()
|
||||||
"/graphql",
|
.route(
|
||||||
get(self::graphql::get).post(self::graphql::post),
|
"/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 {
|
if playground {
|
||||||
router = router.route("/graphql/playground", get(self::graphql::playground));
|
router = router.route("/graphql/playground", get(self::graphql::playground));
|
||||||
|
Reference in New Issue
Block a user