Fungovanie tejto stránky je z dôvodu údržby dočasne obmedzené. Ak článok nevyrieši váš problém a chcete položiť otázku, napíšte našej komunite podpory na Twitter @FirefoxSupport alebo Reddit /r/firefox.

Vyhľadajte odpoveď

Vyhnite sa podvodom s podporou. Nikdy vás nebudeme žiadať, aby ste zavolali alebo poslali SMS na telefónne číslo alebo zdieľali osobné informácie. Nahláste prosím podozrivú aktivitu použitím voľby “Nahlásiť zneužitie”.

Ďalšie informácie

POST Fetch with timeout in URL Loops Requests 10 times

  • Žiadne odpovede
  • 0 má tento problém
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

Ak chcete odpovedať na príspevky, musíte sa prihlásiť do svojho účtu. Ak ešte nemáte účet, položte novú otázku.