Enable CORS Configuration
Browsers require cross-origin resource sharing (CORS) for functions that access responses from browser requests to a domain other than the base page's domain. You must explicitly grant cross-domain access to all applicable ADRUM_n headers.
To enable CORS configuration, define the required AWS response headers in the Amazon API Gateway:
- Access-Control-Expose-Headers
- Maps the custom ADRUM headers. These headers must have the names ADRUM_0 through ADRUM_3 to be compatible with the JavaScript Agent.
- Access-Control-Allow-Methods
- Check the header(s) with the appropriate method.
- Access-Control-Allow-Origin
- Set to the full URL of the web page that originated the request, including schema, hostname, and port.
See AWS documentation for advanced headers and additional details.
After you have enabled CORS, you must define the response header mappings. To configure response header mappings in the Amazon API Gateway, refer to the Amazon documentation.