mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
### Motivation: As outlined in this [issue](https://github.com/apple/swift-nio/issues/2930) by @weissi, the current performance of calling `description` on `HTTPHeaders` is undermined by the dynamism of Array. ### Modifications: The proposed solution replaces the implementation of `description` to iterate over the items and print them out manually. This provides a faster solution since we bypass the cost of calling into `description` of an Array. ### Result: A more performant implementation of `HTTPHeaders` description. --------- Co-authored-by: Johannes Weiss <johannesweiss@apple.com> Co-authored-by: Cory Benfield <lukasa@apple.com>
27 lines
862 B
Bash
27 lines
862 B
Bash
#!/bin/bash
|
|
##===----------------------------------------------------------------------===##
|
|
##
|
|
## 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
|
|
##
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
# shellcheck source=IntegrationTests/tests_01_http/defines.sh
|
|
source defines.sh
|
|
|
|
token=$(create_token)
|
|
start_server "$token"
|
|
do_curl "$token" -H "foo: bar" --http1.0 \
|
|
"http://foobar.com/dynamic/info" >"${tmp:?"tmp variable not set"}/out"
|
|
if ! grep -q 'foo: bar' "$tmp/out"; then
|
|
fail "couldn't find header in response"
|
|
fi
|
|
stop_server "$token"
|