jeremydaly / jeremydaly/lambda-api

CORS Error due to lowercase

Open
#167 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement question
Dominant language
JavaScript
Stars
1.5k
Forks
127
Avg merge
31m
Merged PRs (30d)
2

Description

Firefox will not recognize cors headers due to them being lowercased:

https://github.com/jeremydaly/lambda-api/blob/0b753d855fd5be1f25b5291c78f25171d2151e19/lib/response.js#L68

Removing the "toLowerCase" fixes the issue.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://url.com/bla. (Reason: header ‘sentry-trace’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response).

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://url.com/bla. (Reason: CORS request did not succeed).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The referenced change is in lib/response.js at line 68; inspect the CORS header construction there and reproduce the Firefox preflight failure described in the issue. Done means the response preserves the header form expected by Firefox without the reported CORS error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, nodejs
Domain
api, backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.