Ovo će web mjesto raditi na ograničen način, dok obavljamo održavanje stranice. Ako neki članak ne riješi tvoj problem i ako želiš postaviti pitanje, naša zajednica za podršku spremna je pomoći na Twitteru @FirefoxSupport i na Redditu /r/firefox.

Pretraži podršku

Izbjegni prevare podrške. Nikad te nećemo tražiti da nas nazoveš, da nam pošalješ telefonski broj ili da podijeliš osobne podatke. Prijavi sumnjive radnje pomoću opcije „Prijavi zlouporabu”.

Saznaj više

POST Fetch with timeout in URL Loops Requests 10 times

  • Nema odgovora
  • 0 ima ovaj problem
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.