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

feat(event-handler): allow for cors=None setting #421

Merged
merged 1 commit into from May 6, 2021

Conversation

michaelbrewer
Copy link
Contributor

@michaelbrewer michaelbrewer commented May 5, 2021

Issue #, if available:

Description of changes:

At the route level we should allow for cors=None which means that cors are enabled for this route when configured globally

Global Setting Route Setting Includes cors headers?
app=ApiGatewayResolver() @app.get("/cors", cors=True) Yes
app=ApiGatewayResolver(cors=CORSConfig()) @app.get("/cors", cors=True) Yes
app=ApiGatewayResolver() @app.get("/no-cors", cors=False) No
app=ApiGatewayResolver(cors=CORSConfig()) @app.get("/no-cors", cors=False) No
app=ApiGatewayResolver() @app.get("/no-cors") No
app=ApiGatewayResolver(cors=CORSConfig()) @app.get("/cors") Yes

Checklist

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

At the route level we should allow for cors=None which means that cors are enabled for this route when configured globally
@michaelbrewer michaelbrewer changed the title feat(event-handle): allow for cors=None setting feat(event-handler): allow for cors=None setting May 5, 2021
@michaelbrewer michaelbrewer changed the title feat(event-handler): allow for cors=None setting feat(event-handler): allow for cors=None setting May 5, 2021
@codecov-commenter
Copy link

codecov-commenter commented May 5, 2021

Codecov Report

Merging #421 (f4bd418) into develop (d044463) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #421   +/-   ##
========================================
  Coverage    99.89%   99.89%           
========================================
  Files          101      101           
  Lines         3990     3994    +4     
  Branches       197      198    +1     
========================================
+ Hits          3986     3990    +4     
  Misses           1        1           
  Partials         3        3           
Impacted Files Coverage Δ
aws_lambda_powertools/event_handler/api_gateway.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d044463...f4bd418. Read the comment docs.

@heitorlessa heitorlessa merged commit cbbcc4d into aws-powertools:develop May 6, 2021
@michaelbrewer michaelbrewer deleted the feat-cors-none branch May 6, 2021 05:11
@heitorlessa heitorlessa added this to the 1.15.0 milestone May 6, 2021
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.

None yet

3 participants