Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional default CORS headers with config #583

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

srchase
Copy link
Contributor

@srchase srchase commented Sep 29, 2020

Adds additional CORS headers when converting to an OpenAPI model for Amazon API Gateway.

By default, amz-sdk-invocation-id and amz-sdk-request headers will be added to the CORS preflight request.

On the openapi configuration, the additionalAllowedCorsHeaders option can be used to set other additional headers in place of these default headers, or to omit these default headers entirely by setting an empty array.

Sample config:

{
    "version": "1.0",
    "plugins": {
        "openapi": {
            "service": "smithy.example#Weather",
            "additionalAllowedCorsHeaders": ["foo-header", "bar-header"]
        }
    }
}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@srchase srchase requested a review from mtdowling September 29, 2020 16:09
@srchase srchase force-pushed the additional-allowed-cors branch from f3e51a7 to 6a014d0 Compare September 29, 2020 20:54
@srchase srchase requested a review from mtdowling September 29, 2020 20:54
@srchase srchase force-pushed the additional-allowed-cors branch from 6a014d0 to d1d54c1 Compare September 29, 2020 22:42
@srchase srchase merged commit 027fb84 into smithy-lang:master Sep 29, 2020
@srchase srchase deleted the additional-allowed-cors branch September 29, 2020 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants