Skip to content

Redirect its fails #2

@mastercho

Description

@mastercho

Forward Request /api/forward

var myHeaders = new Headers();
myHeaders.append("x-api-key", "my-auth-key-1");
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var raw = JSON.stringify({
  "tlsClientIdentifier": "chrome_107",
  "requestUrl": "https://auth.spectrasonics.net/useracct/login.php",
  "requestMethod": "POST",
  "followRedirects": true,
  "requestBody": "uname=USER&passwd=PASS&g-recaptcha-response=SOLUTION&submitLogin=true&upgrade=&referrerURL=&redirect=yes"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("127.0.0.1:8080/api/forward", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));


So following request just stucks because cant follow request which is made by body source

<meta http-equiv="refresh" content="0; url=http://www.xxxxxx.com/index.php" />

{"id":"d9e4e1f2-c472-4872-af96-756ca8ebb980","status":200,"target":"https://auth.spectrasonics.net/useracct/login.php","body":" \u003cmeta http-equiv=\"refresh\" content=\"1;url=index.php\" /\u003e\n\n ","headers":{"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Content-Type":["text/html; charset=UTF-8"],"Date":["Fri, 06 Jan 2023 17:30:20 GMT"],"Expires":["Thu, 19 Nov 1981 08:52:00 GMT"],"Pragma":["no-cache"],"Referrer-Policy":["no-referrer-when-downgrade"],"Server":["Apache"],"Set-Cookie":["SpectraUA=86l4sja5khojbfe2vdeockt317; path=/; domain=.spectrasonics.net; secure; HttpOnly"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains"],"X-Content-Type-Options":["nosniff"],"X-Frame-Options":["SAMEORIGIN"],"X-Xss-Protection":["1; mode=block"]},"cookies":{"SpectraUA":"86l4sja5khojbfe2vdeockt317"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions