Files
swift-nio/Tests/NIOHTTP1Tests/HTTPRequestEncoderTest+XCTest.swift
T
Norio Nomura 287d50c373 CONNECT method should not have request body (#637)
* CONNECT method has no request body

### Motivation:

[rfc7231](https://tools.ietf.org/html/rfc7231#section-4.3.6) said:
> A payload within a `CONNECT` request message has no defined semantics;
   sending a payload body on a `CONNECT` request might cause some existing
   implementations to reject the request.

### Modifications:

Change `HTTPMethod.CONNECT.hasRequestBody` to returns `.no`.

### Result:

`HTTPRequestEncoder` does not generate chunked body for `CONNECT` method.

* Change `HTTPMethod.CONNECT.hasRequestBody` to returns `.unlikely`
2018-10-29 22:54:52 -07:00

41 lines
1.4 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
//
//===----------------------------------------------------------------------===//
//
// HTTPRequestEncoderTest+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 HTTPRequestEncoderTests {
static var allTests : [(String, (HTTPRequestEncoderTests) -> () throws -> Void)] {
return [
("testNoAutoHeadersForHEAD", testNoAutoHeadersForHEAD),
("testNoAutoHeadersForGET", testNoAutoHeadersForGET),
("testGETContentHeadersLeftAlone", testGETContentHeadersLeftAlone),
("testNoContentLengthHeadersForHEAD", testNoContentLengthHeadersForHEAD),
("testNoTransferEncodingHeadersForHEAD", testNoTransferEncodingHeadersForHEAD),
("testNoChunkedEncodingForHTTP10", testNoChunkedEncodingForHTTP10),
("testBody", testBody),
("testCONNECT", testCONNECT),
]
}
}