Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
Serverless -- Access-Control-Allow-Origin -- on OPTIONS response but not POST response

I have a HTTP API set up in serverless

betaEmailApi:
    name: beta-email-api
    handler: dist/betaEmail.handler
    events:
      - http:
          path: /v1.0/betaEmail
          method: post
          cors: true

Within the API I'm returning the required headers

{
     headers: {
         'Access-Control-Allow-Origin': '*',
     },
}

For a small subset of users - the Access-Control-Allow-Origin header is present on the OPTIONS response but not the preceding POST.

I've added to a gist here the HAR file snippet - where it shows it correctly getting a response of Access-Control-Allow-Origin for OPTIONS but not POST https://gist.github.com/jake-owen-p/7a47d03d65e969c9e2b694d827f267c3

Access-Control-Allow-Origin not being there is causing cors errors - as its only for a small subset of users I'm unsure

Side Questions

  • The connection number is not persisting between the OPTIONS and POST - could that be causing the issue?
  • I've seen it work for HTTP2 - can HTTP1 be the problem?
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!