Hans Leidekker (@hans) commented about dlls/winhttp/request.c:
if (request->netconn->socket == -1) close = TRUE; else if (request->hdr.disable_flags & WINHTTP_DISABLE_KEEP_ALIVE) close = TRUE; - else if (!query_headers( request, WINHTTP_QUERY_CONNECTION, NULL, connection, &size, NULL ) || - !query_headers( request, WINHTTP_QUERY_PROXY_CONNECTION, NULL, connection, &size, NULL )) + else if (!query_headers( request, WINHTTP_QUERY_CONNECTION | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + NULL, connection, &size, NULL ) || !query_headers( request, WINHTTP_QUERY_PROXY_CONNECTION + | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, NULL, connection, &size, NULL ))
Should we keep checking the response headers? It doesn't seem useful to cache a connection that the server is going to close. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1422#note_17311