Funkcjonalność tej witryny będzie ograniczona w czasie konserwacji. Jeśli artykuł nie rozwiązuje twojego problemu i chcesz zadać pytanie, to nasza społeczność wsparcia jest dostępna na @FirefoxSupport na Twitterze i /r/firefox na Reddicie.

Przeszukaj pomoc

Unikaj oszustw związanych z pomocą.Nigdy nie będziemy prosić Cię o dzwonienie na numer telefonu, wysyłanie SMS-ów ani o udostępnianie danych osobowych. Zgłoś podejrzaną aktywność, korzystając z opcji „Zgłoś nadużycie”.

Więcej informacji

POST Fetch with timeout in URL Loops Requests 10 times

  • Nie ma odpowiedzi
  • 0 osób ma ten 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

Aby odpowiadać na posty, musisz zalogować się na swoje konto. Zadaj pytanie, jeśli nie masz jeszcze konta.