mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-29 05:24:22 +00:00
ContentLengthVerifier Update (#369)
Motivation: Currently http2 ignores content length when handling a response to a HEAD request and handling a 304 response. Modifications: Changing ContentLengthVerifier and any functions called --------- Co-authored-by: George Barnett <gbarnett@apple.com> Co-authored-by: Cory Benfield <lukasa@apple.com>
This commit is contained in:
10 files changed
+294
-103
No files matched your search
@@ -77,10 +77,11 @@ struct ConnectionStreamState {
|
||||
/// - parameters:
|
||||
/// - streamID: The ID of the pushed stream.
|
||||
/// - remoteInitialWindowSize: The initial window size of the remote peer.
|
||||
/// - requestVerb: the HTTP method used on the request
|
||||
/// - throws: If the stream ID is invalid.
|
||||
mutating func createRemotelyPushedStream(streamID: HTTP2StreamID, remoteInitialWindowSize: UInt32) throws {
|
||||
mutating func createRemotelyPushedStream(streamID: HTTP2StreamID, remoteInitialWindowSize: UInt32, requestVerb: String?) throws {
|
||||
try self.reserveServerStreamID(streamID)
|
||||
let streamState = HTTP2StreamStateMachine(receivedPushPromiseCreatingStreamID: streamID, remoteInitialWindowSize: remoteInitialWindowSize)
|
||||
let streamState = HTTP2StreamStateMachine(receivedPushPromiseCreatingStreamID: streamID, remoteInitialWindowSize: remoteInitialWindowSize, requestVerb: requestVerb)
|
||||
self.activeStreams.insert(streamState)
|
||||
}
|
||||
|
||||
@@ -93,9 +94,9 @@ struct ConnectionStreamState {
|
||||
/// - streamID: The ID of the pushed stream.
|
||||
/// - localInitialWindowSize: Our initial window size..
|
||||
/// - throws: If the stream ID is invalid.
|
||||
mutating func createLocallyPushedStream(streamID: HTTP2StreamID, localInitialWindowSize: UInt32) throws {
|
||||
mutating func createLocallyPushedStream(streamID: HTTP2StreamID, localInitialWindowSize: UInt32, requestVerb: String?) throws {
|
||||
try self.reserveServerStreamID(streamID)
|
||||
let streamState = HTTP2StreamStateMachine(sentPushPromiseCreatingStreamID: streamID, localInitialWindowSize: localInitialWindowSize)
|
||||
let streamState = HTTP2StreamStateMachine(sentPushPromiseCreatingStreamID: streamID, localInitialWindowSize: localInitialWindowSize, requestVerb: requestVerb)
|
||||
self.activeStreams.insert(streamState)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user