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 maxAge and cacheControl options to @middy/http-cors #472

Closed
wants to merge 3 commits into from
Closed

Add maxAge and cacheControl options to @middy/http-cors #472

wants to merge 3 commits into from

Conversation

onhate
Copy link
Contributor

@onhate onhate commented Jan 31, 2020

Access-Control-Max-Age

https://fetch.spec.whatwg.org/#http-access-control-max-age

  • Indicates the number of seconds (5 by default) the information provided by the Access-Control-Allow-Methods and Access-Control-Allow-Headers headers can be cached.

Cache-Control

https://stackoverflow.com/questions/40731465/access-control-max-age-vs-cache-control
Some browsers may ignore Access-Control-Max-Age in that case Cache-Control helps to reduce the number calls on pre-flight requests (OPTIONS).

@codecov
Copy link

codecov bot commented Jan 31, 2020

Codecov Report

Merging #472 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #472   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          20     20           
  Lines         547    552    +5     
  Branches      112    115    +3     
=====================================
+ Hits          547    552    +5
Impacted Files Coverage Δ
src/middlewares/cors.js 100% <100%> (ø) ⬆️

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 adda76a...24ba10e. Read the comment docs.

@lmammino
Copy link
Member

Hello @onhate!

This looks like a great addition to the CORS middleware.

Can we target 1.0.0-beta though?

@onhate onhate changed the base branch from master to 1.0.0-beta January 31, 2020 18:06
@onhate onhate changed the base branch from 1.0.0-beta to master January 31, 2020 18:07
@onhate
Copy link
Contributor Author

onhate commented Jan 31, 2020

@lmammino sure, let me re-patch it

@onhate onhate closed this Jan 31, 2020
@onhate onhate deleted the cors-max-age-and-cache-control branch January 31, 2020 18:24
@onhate
Copy link
Contributor Author

onhate commented Jan 31, 2020

Closed in favor to #473

@onhate
Copy link
Contributor Author

onhate commented Feb 5, 2020

@lmammino I have raised another pr #473 targeting 1.0.0-beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants