ladjs / superagent

Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
https://ladjs.github.io/superagent/
MIT License
16.58k stars 1.33k forks source link

access-control-request-headers are in lower case #1620

Open ops1ops opened 3 years ago

ops1ops commented 3 years ago

Can i change the case of headers being sent to server in preflight request? I talk about Access-Control-Request-Headers, so superagent sending Access-Control-Request-Headers: content-type, but my server expects Content-Type and CORS fails

voiceofvega commented 3 years ago

The RFC 7230 ((HTTP/1.1): Message Syntax and Routing ) section 3.2 specifies: Each header field consists of a case-insensitive field name followed by a colon (":"), optional leading whitespace, the field value, and optional trailing whitespace. Thus, lower-cased header names are valid and should be accepted by any compliant server.