Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Testcafe doesn't use the headers as the original request #2052
What is your Scenario?
I am running testcafe tests on an authentication page and I can see that testcafe is modifying/removing/adding the headers when sending the requests to the website and this is blocking me to do 2FA on this page
As soon as I got the issue, I tried to do the automation with Selenium just to confirm it is testcafe issue. As selenium doesn't create proxy to insert the js scripts and automate the website I could do the automation with selenium, but I want to use testcafe as the site is developed in react.
When clicking on the next button I should have the 2FA form asking for the code, but I got a page saying was not possible to do the authentication (Something wrong happened) and I saw the response code for the BeginAuth endpoint was 222 without any response instead of 200.
What is the Current behavior?
testcafe sends the request (I add a _ before the headers missing from testcafe, I remove the tokens and ids and change to variables in bold):
the response code from the testcafe request is 222 unknown and the response body is empty
What is the Expected behavior?
the original request should be something similar like (I add a _ before the headers missing from testcafe, I remove the tokens and ids and change to variables in bold):
the response code from the original request is 200 and the response body is (I remove the tokens and ids and change to variables in bold):
What is your public web site URL?
I removed the ids from the url
Your complete app code (or attach your test files):
these are the functions for the test
Steps to Reproduce:
and add the origin one:
Your Environment details:
@miherlosev thanks for the reply ! yes, I managed to get 200 which is the expected response code when I added the correct
This request is sent to our proxy, but not to the destination server. On the proxy server side we send requests to the destination server without the