only OPTIONS request is sent with a 200 response

Discussão em 'Angular' iniciado por Nie Selam, Novembro 21, 2025.

  1. Nie Selam

    Nie Selam Guest

    My situation is a bit similar to this question but it differs a bit nor there is an answer.

    My backend is python and front-end is Angular. Live sever is Ngnix/Unix while dev is Windows. Every request just sends OPTIONS request, with successful response of 200 but then GET/POST are not followed. It was working perfectly fine and only on production sever is it not working. There are no CORS errors in the console and backend is debug= True for checking purposes but not problems so far cos obviously no get/post is being made.

    On development machine, all is working. Previous team had added a custom header 'language':

    const clonedRequest = req.clone({ headers: req.headers.set('Language', lang) });


    which I noticed is never sent when connected to the live one. In the development setup, I see the following headers:

    Accept application/json
    Accept-Encoding gzip, deflate
    Accept-Language en-US,en;q=0.5
    Connection keep-alive
    Content-Length 21
    Content-Type application/json
    Host 127.0.0.1:9000
    Language en
    Origin http://localhost:4800

    Referer http://localhost:4800/start/forgot-pwd


    When connecting to the production from front end (Development or in production), the Language header is not being sent but I doubt it has issues. Regardless, my CORS on the backend looks like this:

    CORS_ALLOW_HEADERS = (
    'accept',
    'accept-encoding',
    'authorization',
    'content-type',
    'dnt',
    'origin',
    'user-agent',
    'language',
    'x-requested-with',
    )

    Continue reading...

Compartilhe esta Página