Files
swift-nio/Tests/NIOHTTP1Tests/HTTPServerClientTest+XCTest.swift
T
Johannes Weiss e0679121a6 HTTPDecoder: don't crash if response has no headers (#997)
Motivation:

With HTTP/1.0 and EOF framing it's possible to have a HTTP response that
doesn't have any headers. HTTPDecoder unfortunately fell flat on its
face and crashed the program if that happened.

Modifications:

- don't expect headers on responses
- add tests for that
- rename the state machine cases to reflect a request and response
  parsing

Result:

fewer crashes.
2019-05-07 15:38:58 +01:00

44 lines
1.7 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
//
//===----------------------------------------------------------------------===//
//
// HTTPServerClientTest+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 HTTPServerClientTest {
static var allTests : [(String, (HTTPServerClientTest) -> () throws -> Void)] {
return [
("testSimpleGetByteBuffer", testSimpleGetByteBuffer),
("testSimpleGetFileRegion", testSimpleGetFileRegion),
("testSimpleGetChunkedEncodingByteBuffer", testSimpleGetChunkedEncodingByteBuffer),
("testSimpleGetChunkedEncodingFileRegion", testSimpleGetChunkedEncodingFileRegion),
("testSimpleGetTrailersByteBuffer", testSimpleGetTrailersByteBuffer),
("testSimpleGetTrailersFileRegion", testSimpleGetTrailersFileRegion),
("testMassiveResponseByteBuffer", testMassiveResponseByteBuffer),
("testMassiveResponseFileRegion", testMassiveResponseFileRegion),
("testHead", testHead),
("test204", test204),
("testNoResponseHeaders", testNoResponseHeaders),
]
}
}