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

178
Views
If JavaScript Served From Site-A, Issues a POST to Site-B, Will this Cause a CORS Violation?

I'm trying to make certain I understand SOP/CORS policy. The particular scenario I'm interested in is:

An HMTL page and JavaScript are served from domain company-one.com. However, the JavaScript code will issue a POST to domain company-two.com.

First assumption: I think the POST will fail due to origin policy. Is this correct?

Second assumption: If I setup an access control header (Acccess-Control-Allow-Origin: company-one.com) on the company-two.com server, the POST will work. Is this correct?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

  1. The POST will fail, but keep in mind JavaScript fetch/AJAX is not the only way to make POST requests. Even without an Access-Control-Allow-Origin, company-one.com can still make (and automatically submit) a form that would cause a POST request to company-two.com, possibly with the user's cookie.

  2. Yes. Also consider adding Access-Control-Allow-Methods: POST, OPTIONS

about 4 years ago · Juan Pablo Isaza Report
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!