Here is a sample XML template for setting a CORS rules configuration.
CORS rules configuration template
<CORSConfiguration>
<CORSRule>
<Id>Optional: Unique string value that identifies the rule</Id>
<AllowedOrigin>Origin that you want to allow cross-origin requests from</AllowedOrigin>
<AllowedOrigin>A single wildcard is allowed</AllowedOrigin>
<AllowedMethod>HTTP method</AllowedMethod>
<AllowedMethod>HTTP method</AllowedMethod>
<MaxAgeSeconds>Optional: Time, in seconds, the browser can cache the preflight OPTIONS response for a resource</MaxAgeSeconds>
<AllowedHeader>Optional: Header that you want the browser to send. A single wildcard is allowed.</AllowedHeader>
<AllowedHeader>...</AllowedHeader> <!-- Optional -->
<ExposeHeader>Optional: Response header that you want accessible from the browser </ExposeHeader>
<ExposeHeader>...</ExposeHeader> <!-- Optional -->
</CORSRule>
<CORSRule>
...
</CORSRule>
<CORSRule>
...
</CORSRule>
</CORSConfiguration>
© 2015, 2020 Hitachi Vantara LLC. All rights reserved.