aws / aws/aws-sam-cli

HttpApiCorsConfiguration AllowOrigins does not support multiple origins locally

Open
#3,719 10 comments 5 reactions 0 assignees View on GitHub
area/local/start-api blocked/more-info-needed maintainer/need-followup stage/bug-repro
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

### Description:

Using AWS SAM locally AllowOrigins does not work as expected, it concats the list and does not choose the correct origin

### Current Template:

```
HttpApi:
Type: AWS::Serverless::HttpApi
Properties:
CorsConfiguration:
AllowOrigins:
- "http://localhost:3000"
- "http://localhost:3002"
AllowHeaders:
- "*"
AllowMethods:
- "*"
MaxAge: 43200
AllowCredentials: true
```

### Observed result:

![image](https://user-images.githubusercontent.com/24723683/157202795-cadb29e1-7f24-4d76-986d-419418ebae7e.png)

### Expected result:

API Gateway allows multiple origins, SAM local works differently

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.