Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Content-Type is in lower case in AWS API Request Header

I am using AWS Cloudfront and API gateway for a file upload API. I have deployed same code to two different but identical environments. Both the environments are built by the same cloudformation script. We are having a weird issue

When we are uploading file in environment A, we are getting following request

 "headers": {
    
    "content-type": "multipart/form-data; boundary=----WebKitFormBoundarygPe3hR4e1dTzLdBt",

However in environment B I am getting following

 "headers": {
   
    "Content-Type": "multipart/form-data; boundary=----WebKitFormBoundarygPe3hR4e1dTzLdBt",

The difference is Content-Type. In Environment A, I am getting Content-Type in lower case. Not sure why. This behavior is consistent across all browsers.

like image 270
Hitesh Avatar asked Apr 10 '26 07:04

Hitesh


1 Answers

I have just found the same issue.

With a REST Private API: "Content-Type" With a REST Public API: "content-type"

like image 85
jono2010 Avatar answered Apr 13 '26 01:04

jono2010