https://kotlinlang.org logo
#ktor
Title
# ktor
z

Zac Sweers

03/28/2024, 6:09 AM
Are there plans for publish a WASM-compatible
ktor-server-cors
artifact?
a

Aleksei Tirman [JB]

03/28/2024, 6:19 PM
There are no such plans at the moment. Can you please file a feature request?
a

Aleksei Tirman [JB]

03/28/2024, 6:52 PM
Do you actually mean the CORS plugin? Ktor server targets only JVM and *nix targets.
I thought you wanted some kind of CORS configuration for the WASM modules.
z

Zac Sweers

03/28/2024, 8:42 PM
to be honest I’m not entirely sure. My use case is fairly simple - a WASM compose app that makes some API calls to github within the site, but I get errors messages about wrong cors headers. I’m probably a little out of my depth 😅
all the stackoverflow results say to install the cors plugin + set up some headers
a

Aleksei Tirman [JB]

03/28/2024, 9:20 PM
The CORS plugin can be installed only on the server side. If you have no control over the server then you need some kind of proxy.
y

Yogeshvu

03/29/2024, 3:41 PM
Perhaps you just need to add cors headers in the client rest api call
z

Zac Sweers

03/29/2024, 7:43 PM
ah ok. Yeah I probably just need to learn a little more about how this all works