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

v79

11/23/2023, 5:04 PM
Can I override the CORS settings for an individual route in ktor? As in, I have an API which should only be accessed from a particular domain, but I'd like one route to be accessed from anywhere. If so, any idea how? Thanks.
a

Aleksei Tirman [JB]

11/24/2023, 9:59 AM
Since the CORS plugin is route-scoped, you can install it into a route. So you can install the plugin into the routing with the global configuration and into the route with a specific configuration.