Merge pull request #1270 from ProgrammerIn-wonderland/main

fix accidental checking of requestHead when responseHead should be checked
This commit is contained in:
Nariman Jelveh authored and GitHub committed 2025-05-20 15:03:36 -07:00
commit 17e50243f9
1 file changed
+1 -1
@@ -91,7 +91,7 @@ export function pFetch(...args) {
responseHead += decoder.decode(data, { stream: true });
// See if we have the HEAD of an HTTP/1.1 yet
if (reqHead.indexOf("\r\n\r\n") !== -1) {
if (responseHead.indexOf("\r\n\r\n") !== -1) {
dataOffset = responseHead.indexOf("\r\n\r\n");
responseHead = responseHead.slice(0, dataOffset);
const parsedHead = parseHTTPHead(responseHead);