Skip to content

Commit

Permalink
Merge pull request #31 from guoye-zhang/contributors
Browse files Browse the repository at this point in the history
Update contributors
  • Loading branch information
guoye-zhang authored Sep 19, 2023
2 parents 31ddb8d + 43107b6 commit 99d066e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ needs to be listed here.

### Contributors

- Franz Busch <[email protected]>
- Guoye Zhang <[email protected]>
- Jager-yoo <[email protected]>
- Sergey Dmitriev <[email protected]>
- Tomohiro Kumagai <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion Sources/HTTPTypes/HTTPField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions Sources/HTTPTypes/HTTPRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/HTTPTypes/HTTPResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Tests/HTTPTypesTests/HTTPTypesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 99d066e

Please sign in to comment.