-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
Description
This is a Bug Report
Description
When Cors is enabled for multiple endpoints that have the same path the Methods are merged into the one CORS OPTION response, but header or origin config created by the separate http events isn't merged into one OPTION request. Following is an example:
functions:
blog:
handler: handler.handler
events:
- http:
path: posts
method: get
cors:
origins:
- http://example.com
- http:
path: posts
method: post
cors:
origins:
- http://example2.com
- http:
path: posts/{id}
method: put
cors:
headers:
- TestHeader
- http:
path: posts/{id}
method: delete
cors:
headers:
- TestHeader2
The resulting OPTION CORS request should return both origins and both headers as allowed headers and origins, but it doesn't. This was brought up for methods in #1960 and fixed in #1951 for methods, but not fixed for others.
Similar or dependent issues:
Additional Data
- _Serverless Framework Version you're using_:
- _Operating System_:
- _Stack Trace_:
- _Provider Error messages_: