How to add in wildcard to URLs in CORS setting for Dgraph Cloud / Slash GraphQL

I am using Firebase deploy previews for a website that is using a GraphQL schema from Dgraph.
With each PR in Github Firebase creates a unique url that looks something like https://my-firebase-project-random-text-web.app.

I was hoping to add a wild card for these URLs in the CORS setting (something like https://my-firebase-project*.web.app/) but it doesn’t seem to work. I would also like to add a wild card to all subdomains for a URL but this also doesn’t work (something like https://*.mywebsite.com).

Is there a way I can achieve this?

1 Like

Hi @charklewis ,
You can set CORS origins via schema as mentioned here and send in a schema update. Could you please see if this helps?

Hello @anand I have tested this and it also does not work with wildcards.

I have tried the following, does the CORS settings respect wild cards?

# Dgraph.Allow-Origin "https://*.example.com" 
# Dgraph.Allow-Origin "https://my-firebase-project*.web.app" 

It does work when I put in the full URL.

1 Like

Thanks for the clarification @charklewis . We are looking into this.

1 Like

Hi @charklewis
CORS settings do not support wildcards.
We are happy to take this as a feature request.
cc: @abhimanyusinghgaur , @JatinDevDG

1 Like