J'ai un formulaire d'authentification (page login.htm) qui envoie le login et password en HTTP POST.
Si ces paramètres authentification sont valident, le serveur (dont je peux modifier la configuration) renvoie une redirection vers la page index.htm et un cookie de session.
Après avoir reçu la redirection (HTTP/1.1 302 Found, Location: index.htm), Firefox execute deux HTTP GET sur index.htm : pourquoi fait-il deux chargements au lieu de un ? (ça fait ralentir le chargement de la page index lors de l'authentification).
Ci-dessous les logs des headers HTTP de la transaction.
Code : Tout sélectionner
>>> [Firefox] HTTP POST "/login.htm":
[quote]Host: 10.0.202.140
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Accept: */*
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br, zstd
Referer: https://10.0.202.140/login.htm
Content-Type: application/x-www-form-urlencoded
Content-Length: 27
Origin: https://10.0.202.140
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Priority: u=0[/quote]
<< [Serveur] Response header:
[quote]HTTP/1.1 302 Found
Location: index.htm
Connection: close
Set-Cookie: SESSION_ID=y1ou_KZql1UuGYM-Nzt9MA; path=/; HttpOnly; Secure
Set-Cookie: STATUS=0; path=/; Secure
Content-Type: text/html[/quote]
>>> [Firefox] HTTP GET "/index.htm":
[quote]Host: 10.0.202.140
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Accept: */*
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br, zstd
Referer: https://10.0.202.140/login.htm
Connection: keep-alive
Cookie: SESSION_ID=y1ou_KZql1UuGYM-Nzt9MA; STATUS=0
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Priority: u=0[/quote]
<< [Serveur] Response header:
[quote]HTTP/1.1 200 OK
Connection: keep-alive
Keep-Alive: timeout=5, max=1000
Cache-Control: no-cache
ETag: "458090420232tcO"
Content-Type: text/html
Content-Encoding: gzip
Content-Length: 199438[/quote]
>>> [Firefox] HTTP GET "/index.htm":
[quote]Host: 10.0.202.140
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br, zstd
Connection: keep-alive
Referer: https://10.0.202.140/login.htm
Cookie: SESSION_ID=y1ou_KZql1UuGYM-Nzt9MA; STATUS=0
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i[/quote]
<< [Serveur] Response header:
[quote]HTTP/1.1 200 OK
Connection: keep-alive
Keep-Alive: timeout=5, max=1000
Cache-Control: no-cache
ETag: "458090420232tcO"
Content-Type: text/html
Content-Encoding: gzip
Content-Length: 199438[/quote]
On voit que le serveur répond la même chose pour les deux HTTP GET index.htm... alors pourquoi Firefox n’accepte pas la première réponse ?
=> Je ne vois aucun message d'erreur explicite dans la console de debug de Firefox et l'onglet réseau.
Une fois la page index.htm chargée, si je fais un rafraichissement de la page, tout fonctionne correctement (il n'y a qu'un seul chargement de la page index.htm) :
>>> [Firefox] HTTP GET "/index.htm":
[quote]Host: 10.0.202.140
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br, zstd
Referer: https://10.0.202.140/login.htm
Connection: keep-alive
Cookie: SESSION_ID=8EL8t8uhuy6JjAdS8k6nNw; STATUS=0
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
If-None-Match: "458090420232tcO"
Priority: u=0, i[/quote]
<< [Server] Response header:
[quote]HTTP/1.1 304 Not Modified
Connection: keep-alive
Keep-Alive: timeout=5, max=1000
Cache-Control: no-cache
ETag: "458090420232tcO"
Content-Type: text/html
Content-Encoding: gzip
Content-Length: 0[/quote]
Même chose si je fais un rafraichissement en vidant le cache :
>>> [Firefox] HTTP GET "/index.htm":
[quote]Host: 10.0.202.140
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br, zstd
Referer: https://10.0.202.140/login.htm
Connection: keep-alive
Cookie: SESSION_ID=8EL8t8uhuy6JjAdS8k6nNw; STATUS=0
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i
Pragma: no-cache
Cache-Control: no-cache[/quote]
<< [Serveur] Response header:
[quote]HTTP/1.1 200 OK
Connection: keep-alive
Keep-Alive: timeout=5, max=1000
Cache-Control: no-cache
ETag: "458090420232tcO"
Content-Type: text/html
Content-Encoding: gzip
Content-Length: 199438[/quote]