mirror of
https://github.com/apple/swift-nio
synced 2026-11-26 04:57:49 +00:00
Motivation: Previously we thought that if we have some bytes left that belong to an upgraded protocol, we should deliver those as an error. This is implemented on `master` but not in any released NIO version. However, no other handler sends errors on unclean shutdown, so it feels wrong to do it in this one very specific case (EOF on inflight upgrade with data for the upgraded protocol) Modifications: Remove the error again. Result: Less behaviour change to the last released NIO version.
57 lines
3.0 KiB
Swift
57 lines
3.0 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftNIO open source project
|
|
//
|
|
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// HTTPDecoderTest+XCTest.swift
|
|
//
|
|
import XCTest
|
|
|
|
///
|
|
/// NOTE: This file was generated by generate_linux_tests.rb
|
|
///
|
|
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
|
|
///
|
|
|
|
extension HTTPDecoderTest {
|
|
|
|
static var allTests : [(String, (HTTPDecoderTest) -> () throws -> Void)] {
|
|
return [
|
|
("testDoesNotDecodeRealHTTP09Request", testDoesNotDecodeRealHTTP09Request),
|
|
("testDoesNotDecodeFakeHTTP09Request", testDoesNotDecodeFakeHTTP09Request),
|
|
("testDoesNotDecodeHTTP2XRequest", testDoesNotDecodeHTTP2XRequest),
|
|
("testToleratesHTTP13Request", testToleratesHTTP13Request),
|
|
("testDoesNotDecodeRealHTTP09Response", testDoesNotDecodeRealHTTP09Response),
|
|
("testDoesNotDecodeFakeHTTP09Response", testDoesNotDecodeFakeHTTP09Response),
|
|
("testDoesNotDecodeHTTP2XResponse", testDoesNotDecodeHTTP2XResponse),
|
|
("testToleratesHTTP13Response", testToleratesHTTP13Response),
|
|
("testCorrectlyMaintainIndicesWhenDiscardReadBytes", testCorrectlyMaintainIndicesWhenDiscardReadBytes),
|
|
("testDropExtraBytes", testDropExtraBytes),
|
|
("testDontDropExtraBytesRequest", testDontDropExtraBytesRequest),
|
|
("testDontDropExtraBytesResponse", testDontDropExtraBytesResponse),
|
|
("testExtraCRLF", testExtraCRLF),
|
|
("testSOURCEDoesntExplodeUs", testSOURCEDoesntExplodeUs),
|
|
("testExtraCarriageReturnBetweenSubsequentRequests", testExtraCarriageReturnBetweenSubsequentRequests),
|
|
("testIllegalHeaderNamesCauseError", testIllegalHeaderNamesCauseError),
|
|
("testNonASCIIWorksAsHeaderValue", testNonASCIIWorksAsHeaderValue),
|
|
("testDoesNotDeliverLeftoversUnnecessarily", testDoesNotDeliverLeftoversUnnecessarily),
|
|
("testHTTPResponseWithoutHeaders", testHTTPResponseWithoutHeaders),
|
|
("testBasicVerifications", testBasicVerifications),
|
|
("testNothingHappensOnEOFForLeftOversInAllLeftOversModes", testNothingHappensOnEOFForLeftOversInAllLeftOversModes),
|
|
("testBytesCanBeForwardedWhenHandlerRemoved", testBytesCanBeForwardedWhenHandlerRemoved),
|
|
("testBytesCanBeFiredAsErrorWhenHandlerRemoved", testBytesCanBeFiredAsErrorWhenHandlerRemoved),
|
|
("testBytesCanBeDroppedWhenHandlerRemoved", testBytesCanBeDroppedWhenHandlerRemoved),
|
|
]
|
|
}
|
|
}
|
|
|