Този сайт ще има ограничена функционалност, докато се извършва тече неговата поддръжка. Ако дадена статия не може реши проблема ви и искате да зададете въпрос, нашата общност е готова да ви помогне на @firefox в Twitter и /r/firefox в Reddit.

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

POST Fetch with timeout in URL Loops Requests 10 times

  • Няма отговори
  • 0 имат този проблем
more options

Scenario: I am running a node.js UI that proxies requests to the backend API. When `timeout=10` (or any valid timeout) is located in the request URL, the request will be proxied at the timeout interval ten times. In this example, every ten seconds it will reattempt for ten attempts.

If I run the same code in another browser's console, it is only executed once.

I am suspecting that there is some pre-parsing of the URL that is occurring that is making this happen.

Fetch Command: ``` await fetch("http://localhost:8080/config?timeout=10", {

   "credentials": "omit",
   "headers": {
       "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0",
       "Accept": "application/json",
       "Accept-Language": "en-US,en;q=0.5",
       "Content-Type": "application/json",
       "Sec-Fetch-Dest": "empty",
       "Sec-Fetch-Mode": "cors",
       "Sec-Fetch-Site": "same-origin",
       "Priority": "u=0",

"Timeout": 40

   },
   "referrer": "http://localhost:8080/swagger/index.html?config=/config/swagger",
   "method": "POST",
   "mode": "cors"

}); ```

In the POST API, there is a 30 second sleep, then it raises a 408 error code.

Environment: Firefox 132.0.2 (64-bit) Windows 10

Scenario: I am running a node.js UI that proxies requests to the backend API. When `timeout=10` (or any valid timeout) is located in the request URL, the request will be proxied at the timeout interval ten times. In this example, every ten seconds it will reattempt for ten attempts. If I run the same code in another browser's console, it is only executed once. I am suspecting that there is some pre-parsing of the URL that is occurring that is making this happen. Fetch Command: ``` await fetch("http://localhost:8080/config?timeout=10", { "credentials": "omit", "headers": { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0", "Accept": "application/json", "Accept-Language": "en-US,en;q=0.5", "Content-Type": "application/json", "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "same-origin", "Priority": "u=0", "Timeout": 40 }, "referrer": "http://localhost:8080/swagger/index.html?config=/config/swagger", "method": "POST", "mode": "cors" }); ``` In the POST API, there is a 30 second sleep, then it raises a 408 error code. Environment: Firefox 132.0.2 (64-bit) Windows 10

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.