Skip to content

fix issue with content-type being overwritten#429

Closed
jameselkins wants to merge 1 commit intoaws:developfrom
atlas-health:je/fix_header_lowercase_issue
Closed

fix issue with content-type being overwritten#429
jameselkins wants to merge 1 commit intoaws:developfrom
atlas-health:je/fix_header_lowercase_issue

Conversation

@jameselkins
Copy link

I was running into issues where an express server, imported using https://github.com/awslabs/aws-serverless-express/tree/master/example and using custom middleware was returning header names in lowercase. This is valid according to the spec: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 and so aws-sam-cli should not force servers to use a capitalized header name (i.e. content-type is as good as Content-Type .

The issues were that a content-type of text/html was being returned, but aws-sam-cli would replace it with application/json.

Description of changes:
sometimes servers return headers keys in lowercase. This looks for those and uppercases the Content-Type header appropriately

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…ose and uppercases the Content-Type header appropriately
@jfuss
Copy link
Contributor

jfuss commented May 23, 2018

Please follow the CONTRIBUTING.md file before submitting PR.

Closing as this was already addressed and merged in #398

@jfuss jfuss closed this May 23, 2018
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.

2 participants