From 43107b6de15f0bd81b3c620b2ef12eccbb3aed57 Mon Sep 17 00:00:00 2001 From: Guoye Zhang Date: Tue, 19 Sep 2023 12:24:27 -0700 Subject: [PATCH] Update contributors --- CONTRIBUTORS.txt | 2 ++ Sources/HTTPTypes/HTTPField.swift | 2 +- Sources/HTTPTypes/HTTPRequest.swift | 9 +++++++-- Sources/HTTPTypes/HTTPResponse.swift | 2 +- Tests/HTTPTypesTests/HTTPTypesTests.swift | 4 ++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index ff94868..b4883d0 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -11,7 +11,9 @@ needs to be listed here. ### Contributors +- Franz Busch - Guoye Zhang +- Jager-yoo - Sergey Dmitriev - Tomohiro Kumagai diff --git a/Sources/HTTPTypes/HTTPField.swift b/Sources/HTTPTypes/HTTPField.swift index 9652b0e..306600a 100644 --- a/Sources/HTTPTypes/HTTPField.swift +++ b/Sources/HTTPTypes/HTTPField.swift @@ -144,7 +144,7 @@ public struct HTTPField: Sendable, Hashable { } static func legalizeValue(_ value: ISOLatin1String) -> ISOLatin1String { - if Self._isValidValue(value._storage.utf8) { + if self._isValidValue(value._storage.utf8) { return value } else { let bytes = value._storage.utf8.lazy.map { byte -> UInt8 in diff --git a/Sources/HTTPTypes/HTTPRequest.swift b/Sources/HTTPTypes/HTTPRequest.swift index fd296b6..269ad6e 100644 --- a/Sources/HTTPTypes/HTTPRequest.swift +++ b/Sources/HTTPTypes/HTTPRequest.swift @@ -289,8 +289,13 @@ extension HTTPRequest.PseudoHeaderFields: Codable { guard HTTPField.isValidToken(method.rawValue._storage) else { throw DecodingError.dataCorruptedError(in: container, debugDescription: "\"\(method.rawValue._storage)\" is not a valid method") } - self.init(method: method, scheme: scheme, authority: authority, path: path, - extendedConnectProtocol: extendedConnectProtocol) + self.init( + method: method, + scheme: scheme, + authority: authority, + path: path, + extendedConnectProtocol: extendedConnectProtocol + ) } } diff --git a/Sources/HTTPTypes/HTTPResponse.swift b/Sources/HTTPTypes/HTTPResponse.swift index bf25a13..5d5bc40 100644 --- a/Sources/HTTPTypes/HTTPResponse.swift +++ b/Sources/HTTPTypes/HTTPResponse.swift @@ -123,7 +123,7 @@ public struct HTTPResponse: Sendable, Hashable { } static func legalizingReasonPhrase(_ reasonPhrase: String) -> String { - if Self.isValidReasonPhrase(reasonPhrase) { + if self.isValidReasonPhrase(reasonPhrase) { return reasonPhrase } else { let scalars = reasonPhrase.unicodeScalars.lazy.map { scala -> UnicodeScalar in diff --git a/Tests/HTTPTypesTests/HTTPTypesTests.swift b/Tests/HTTPTypesTests/HTTPTypesTests.swift index 0a98d91..c5dc1cf 100644 --- a/Tests/HTTPTypesTests/HTTPTypesTests.swift +++ b/Tests/HTTPTypesTests/HTTPTypesTests.swift @@ -163,7 +163,7 @@ final class HTTPTypesTests: XCTestCase { ["name": "Accept-Encoding", "value": "br"], ["name": "Accept-Encoding", "value": "gzip"], ["name": "Content-Length", "value": "1024"], - ] + ], ]) let decoded = try JSONDecoder().decode(HTTPRequest.self, from: encoded) @@ -185,7 +185,7 @@ final class HTTPTypesTests: XCTestCase { "reasonPhrase": "No Content", "headerFields": [ ["name": "Server", "value": "HTTPServer/1.0", "indexingStrategy": 1], - ] + ], ]) let decoded = try JSONDecoder().decode(HTTPResponse.self, from: encoded)