Enable “Try it” in Dev Portal for requests with any header

Configures the CORS plugin to support sending requests with any headers from the Dev Portal spec renderer. You must use this configuration if the Routes associated with your API specs include any headers, standard or custom.

Prerequisites

  • If the Routes associated with your API specs use any headers, add methods: OPTIONS to any Routes that use the headers.

  • If the Routes associated with your API specs require custom headers to match (the request has to be made with the specified header, otherwise the request will be a 404), configure one of the following:

    • Add a new Route at the same path with methods: OPTIONS configured
    • Add a global Route at the Control Plane-level with methods: OPTIONS configured. You don’t need to specify any path.

Environment variables

  • PORTAL_URL: The full URL of your Dev Portal, including the protocol. For example: https://domain.us.kongportals.com

  • HEADER: The name of your header.

Set up the plugin

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!