mirror of
https://github.com/apple/swift-nio
synced 2026-11-26 04:57:49 +00:00
match all values in HTTPHeaders.isKeepAlive(...) HTTPHeaders.isKeepAlive(...) does only match the first value. ### Motivation: Keep-alive and Close may be something on comma separated arrays ### Modifications: - Made an extension function to `ByteBuffer` that could separate the strings at low level, without Swift string API, so that it could split the values - Another extension functions that compares the comma separated array with a given array to tell the caller which exists and which no - Added unit tests for them - Used them in the HTTPHeader ### Result: - Now, if a request is sent using Keep-alive or Close where it was in an array, it will be handled - fixes #410
35 lines
969 B
Swift
35 lines
969 B
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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// ByteBufferUtilsTest+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 ByteBufferUtilsTest {
|
|
|
|
static var allTests : [(String, (ByteBufferUtilsTest) -> () throws -> Void)] {
|
|
return [
|
|
("testComparators", testComparators),
|
|
("testTrimming", testTrimming),
|
|
]
|
|
}
|
|
}
|
|
|