这是indexloc提供的服务,不要输入任何密码
Skip to content

server: Support custom URI schemes in CORS config #5818

@pkvince

Description

@pkvince

It would be great if we could specify custom URI schemes in the HASURA_GRAPHQL_CORS_DOMAIN list. Right now it only supports http:// and https://.

We have recently started using Ionic's CapacitorJS to build our webapp into mobile apps (inside a webview). The following scheme is used for iOS: capacitor://localhost, but I am unable to add it to Hasura's CORS config.

See following error:

Fatal Error:- Environment variable HASURA_GRAPHQL_CORS_DOMAIN: invalid domain: 'capacitor://localhost'. All domains should have scheme + (optional wildcard) host + (optional port)

I also tried to use a wildcard as the scheme:

Fatal Error:- Environment variable HASURA_GRAPHQL_CORS_DOMAIN: invalid domain: '*://localhost'. All domains should have scheme + (optional wildcard) host + (optional port)

Right now my solution is to allow any domain for CORS... I know I could probably setup a reverse proxy to handle CORS, but I feel like this could be easily supported using custom schemes, or wildcard as the scheme in Hasura directly.

Let me know if I can be of any help to support this! Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    c/serverRelated to serverk/enhancementNew feature or improve an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions