johnc44

Results 22 comments of johnc44

For some reason I couldn't seem to find it earlier, but this is the official sam doc which mentions the extra quotes: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#cors-configuration > For example, "'www.example.com'".

@awood45 - noticed this has "more info needed" tag - are you needing anything further from me? I also don't think this should be classified as a feature request as...

Thanks, @jfuss - after writing the above I did discover that other PR. That's great news - thanks. Regarding the CORS thing, I'm not 100% sure I understand. At one...

@jfuss - I had a quick look at the code. In _get_cors_prop inside sam_api_provider.py it explicitly checks to see if a property is a string and that it is enclosed...

@jfuss - I forked the repo and made the change (https://github.com/johnc44/aws-sam-cli/blob/74c8a0a06a26b7ee08a451e39d0322ef3a22cc90/samcli/lib/providers/sam_api_provider.py#L150) From a quick test, I could start the API up and all the unit tests pass. I've not really...

@jfuss - was having another look at this, and think the answer is actually very simple. If the CORS header refers to a dictionary or a cfn function (e.g. !Ref)...

@jfuss - I don't really agree with this. At the moment I'm in the situation where it doesn't work at all locally, so I either have to hack my yaml...

@jfuss - can we not just remove the breaking change until it can be done properly?

@jfuss A change was made in SAM which specifically checks for the CORS value to be surrounding in quotes. If it's not, it raises an error. With that check removed,...

@jfuss - that would be great, thank you. If the check is still valuable, it can still be done, but just not for dictionaries or strings starting !. (If you...