-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: cors httpapi #1381
feat: cors httpapi #1381
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1381 +/- ##
===========================================
- Coverage 94.36% 93.93% -0.43%
===========================================
Files 78 78
Lines 4685 4686 +1
Branches 937 953 +16
===========================================
- Hits 4421 4402 -19
- Misses 121 132 +11
- Partials 143 152 +9
Continue to review full report at Codecov.
|
e70d418
to
d3e0d76
Compare
DefinitionBody: | ||
info: | ||
version: '1.0' | ||
title: | ||
Ref: AWS::StackName | ||
# when this is specified `CorsConfiguration` property is ignored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question about this. What we need to decide is if CorsConfiguration
should override, merge, or be ignored if there already exists a configuration in the openapi document.
This brings up the bigger question of how do we do this in other areas of SAM for HTTP APIs. I will need to check on this, but I believe that:
- If a configuration doesn't exist in the openapi document, SAM should add it
- If a configuration exists, SAM should have a set pattern of either ignoring or overriding it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed offline, I think we need to merge the CorsConfiguration
with open api cors extension header if exists and override by giving preference to values in CorsConfiguration
property. This way SAM can give the flexibility for template authors to override some of the cors headers mentioned in CorsConfiguration
property and also will be able to add other/new Cors headers irrespective of SAMs support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the code to merge and override CorsConfiguration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are now ignoring the configurations here if there is a corresponding configuration in CorsConfiguration
(remove comment)
d1b4649
to
f87ad72
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1381 +/- ##
===========================================
- Coverage 94.36% 94.01% -0.35%
===========================================
Files 78 78
Lines 4685 4779 +94
Branches 937 965 +28
===========================================
+ Hits 4421 4493 +72
- Misses 121 133 +12
- Partials 143 153 +10 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work so far! few comments in the review.
Codecov Report
@@ Coverage Diff @@
## develop #1381 +/- ##
==========================================
Coverage ? 94.14%
==========================================
Files ? 78
Lines ? 4780
Branches ? 965
==========================================
Hits ? 4500
Misses ? 130
Partials ? 150
Continue to review full report at Codecov.
|
211a6bb
to
74965d1
Compare
DefinitionBody: | ||
info: | ||
version: '1.0' | ||
title: | ||
Ref: AWS::StackName | ||
# when this is specified `CorsConfiguration` property is ignored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are now ignoring the configurations here if there is a corresponding configuration in CorsConfiguration
(remove comment)
In this PR, |
Codecov Report
@@ Coverage Diff @@
## develop #1381 +/- ##
===========================================
- Coverage 94.40% 94.14% -0.26%
===========================================
Files 78 78
Lines 4716 4780 +64
Branches 948 965 +17
===========================================
+ Hits 4452 4500 +48
- Misses 121 130 +9
- Partials 143 150 +7 Continue to review full report at Codecov.
|
Issue #, if available:
#1295
Description of changes:
Description of how you validated changes:
Checklist:
make pr
passesexamples/2016-10-31
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.