Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda