question

AsharaJay avatar image
0 Votes"
AsharaJay asked AsharaJay commented

CORS in Azure Function for Capacitor ios

I am developing capacitor app using ionic where as per new iOS version it cannot allow to use http or https because it's reserved scheme in iOS. So when the app ran it starts with capacitor://localhost and when I tries to add in azure function CORS it won't allow me to add scheme other than http / https.

One possible work around is API Management (NOT 100% sure). But my question here is why can't we use default Azure Function CORS other than http or https?

azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PramodValavala-MSFT avatar image
0 Votes"
PramodValavala-MSFT answered AsharaJay commented

@AsharaJay CORS is more part of the security built into browers and compliant servers just require sending back the right headers. So you could always include the required headers in your response manually or even leverage function proxies to add them for you.

You could also workaround this or even totally disable CORS though not recommended.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @PramodValavala-MSFT I think function proxies is additional efforts and another solution is implementing API management but I always not in favour of workaround. I would like if there is an option to use custom schema in CORS for function apps.

By the way, I am keeping * in CORS in azure function app that's the fastest solution for now for me and make workaround at code side.

0 Votes 0 ·

@AsharaJay At the moment, using a proxy or adding the headers manually is the way forward. I will check with the concerning team to see if support for custom schemes can be added.

0 Votes 0 ·
AsharaJay avatar image AsharaJay PramodValavala-MSFT ·

Thanks @PramodValavala-MSFT. Cheers!

0 Votes 0 ·