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

164
Visualizações
Getting CORS error after allowing Origins

My frontend and backend services are in different origins, hence problem with CORS. But in my backend (python fastAPI) I have already added allow all origins:

api.add_middleware(
    CORSMiddleware,
    allow_origin_regex=".*",
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

This is how my frontend is making the call

fetch('https://someurl.com/call', {
        method: 'POST',
        headers:{
            'Content-Type': 'application/x-www-form-urlencoded',
            'Signature': btoa('0000')
        },
        body: new URLSearchParams({

        })
    }).then(res => {
        return res.json()
    })

Error that I am getting:

Access to fetch at 'https://someurl.com/call' from origin 'https://frontend.com' has been blocked by CORS policy: Request header field signature is not allowed by Access-Control-Allow-Headers in preflight response.

Is there something I am missing? Is my custom header 'Signature': btoa('0000') the problem?

I am trying to debug, this is what I am getting from the browser console enter image description here

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