Skip to content

Commit

Permalink
fix(http2): fixed 1xx handling issue
Browse files Browse the repository at this point in the history
Used to break on 1xx headers, but fetch should ignore it and wait for the _real_ response

fix #113
  • Loading branch information
grantila committed Oct 3, 2021
1 parent c1fadc9 commit 3d28301
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions lib/fetch-http2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,6 @@ async function fetchImpl(
reject( make100Error( ) );
} ) );

stream.on( "headers", guard(
( headers: IncomingHttp2Headers, _flags: any ) =>
{
const code = headers[ HTTP2_HEADER_STATUS ];
reject( new Error(
`Request failed with a ${code} status. ` +
"Any 1xx error is unexpected to fetch() and " +
"shouldn't happen." ) );
}
) );

stream.on( "response", guard( ( headers: IncomingHttp2Headers ) =>
{
const {
Expand Down

0 comments on commit 3d28301

Please sign in to comment.