Recently our devs implemented a CSRF protection, and then my scripts (web ui) started to fail one by one. I looked into it and it's getting this error on console

Access to XMLHttpRequest at 'https://url.com' (redirected from 'url') from origin 'https://url.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

any idea how to get around with this?

  • 1
    Why don't you disable CSRF protection in the test enviorments? Mar 29, 2021 at 22:20
  • For some reason, "they" won't allow that to happen so the choice is to disable the test or find a workaround
    – agvera
    Mar 30, 2021 at 4:52
  • 1
    If you can't find a way, I would suggest contacting people with better influence. "for some reason" is what kids know about why their parents make decisions they don't like, it's not an acceptable discourse between professionals. Mar 30, 2021 at 8:12
  • 1
    what step you are trying to do that throws this error ? are you trying to execute some javascript request from your test script ?
    – PDHide
    Mar 30, 2021 at 18:25


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.