You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2025. It is now read-only.
// Since we used up any previous partial piece if there was one, we clear it.
93
+
partial='';
94
+
95
+
// We slice off what we just added, saving further data for another header.
96
+
// This could end the while loop, if the end of this chunk is also the end of a header.
97
+
data=data.slice(m.index+m[0].length);
98
+
99
+
}else{
100
+
// No \r?\n, so we must have partial data, and just save it for the next go round.
101
+
// Hypothetically, data could equal "ntent-Type: text/ht" here and partial could
102
+
// equal "Co" ?-- neither a complete start nor end of a header.
103
+
// If there's partial stuff from before, we add to it.
104
+
partial=partial+data;
105
+
106
+
// And since we saved it, clear it out. Oh hey, and it ends the while loop. This chunk is _done_.
107
+
data='';
108
+
}
109
+
}
110
+
111
+
// okay, so the question is we are never flipping the switch onBOdy so we will always hit this if else after headers are parsed which is what we don't wnat? :P
112
+
// Correct! Let's get header parsing work, then flip the bit when we find the end of headers. Hard to do in the opposite order, since they haven't arrived yet.
113
+
114
+
115
+
this.push(data)// Just pass it on. for now.
53
116
next();// Ready for next chunk.
54
117
})).pipe(response);
55
118
// Whatever comes out of our header-splitting stream parser must be the
0 commit comments