mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-27 05:04:23 +00:00
ignore frames that don't have a HTTP/1 equivalent (#146)
Motivation: Previously, the H2to1 codec would crash if for example a push promise came by. Modifications: Instead of crashing, ignore the frames without equivalent. Result: Fewer crashes.
This commit is contained in:
1 parent
17434a9658
commit
7de397fda8
3 files changed
+25
-5
No files matched your search
@@ -79,12 +79,9 @@ public final class HTTP2ToHTTP1ClientCodec: ChannelInboundHandler, ChannelOutbou
|
||||
if content.endStream {
|
||||
context.fireChannelRead(self.wrapInboundOut(.end(nil)))
|
||||
}
|
||||
case .alternativeService, .rstStream, .priority, .windowUpdate:
|
||||
// All these frames may be sent on a stream, but are ignored by the multiplexer and will be
|
||||
// handled elsewhere.
|
||||
case .alternativeService, .rstStream, .priority, .windowUpdate, .settings, .pushPromise, .ping, .goAway, .origin:
|
||||
// These don't have an HTTP/1 equivalent, so let's drop them.
|
||||
return
|
||||
default:
|
||||
fatalError("unimplemented frame \(frame)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user