From 61e5d5b30f039f95ccad154c5ddf2b0661f0a847 Mon Sep 17 00:00:00 2001 From: Chris Hulbert Date: Tue, 12 Sep 2023 11:18:48 +1000 Subject: [PATCH 1/2] More status codes --- FlyingFox/Sources/HTTPStatusCode.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FlyingFox/Sources/HTTPStatusCode.swift b/FlyingFox/Sources/HTTPStatusCode.swift index 1e8733e1..c843c66d 100644 --- a/FlyingFox/Sources/HTTPStatusCode.swift +++ b/FlyingFox/Sources/HTTPStatusCode.swift @@ -89,6 +89,9 @@ public extension HTTPStatusCode { static let expectationFailed = HTTPStatusCode(417, phrase: "Expectation Failed") static let teapot = HTTPStatusCode(418, phrase: "I'm a teapot") static let misdirectedRequest = HTTPStatusCode(421, phrase: "Misdirected Request") + static let unprocessableContent = HTTPStatusCode(422, phrase: "Unprocessable Content") + static let locked = HTTPStatusCode(423, phrase: "Locked") + static let failedDependency = HTTPStatusCode(424, phrase: "Failed Dependency") static let tooEarly = HTTPStatusCode(425, phrase: "Too Early") static let upgradeRequired = HTTPStatusCode(426, phrase: "Upgrade Required") static let preconditionRequired = HTTPStatusCode(428, phrase: "Precondition Required") From ef8ca38216bfff88f7571cd598b00cbcd9ae2f96 Mon Sep 17 00:00:00 2001 From: Chris Hulbert Date: Tue, 12 Sep 2023 11:20:24 +1000 Subject: [PATCH 2/2] Tests --- FlyingFox/Tests/HTTPStatusCodeTests.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FlyingFox/Tests/HTTPStatusCodeTests.swift b/FlyingFox/Tests/HTTPStatusCodeTests.swift index 3e2be8ba..097a6732 100644 --- a/FlyingFox/Tests/HTTPStatusCodeTests.swift +++ b/FlyingFox/Tests/HTTPStatusCodeTests.swift @@ -83,6 +83,9 @@ final class HTTPStatusCodeTests: XCTestCase { XCTAssertEqual(HTTPStatusCode.expectationFailed, HTTPStatusCode(417, phrase: "Expectation Failed")) XCTAssertEqual(HTTPStatusCode.teapot, HTTPStatusCode(418, phrase: "I'm a teapot")) XCTAssertEqual(HTTPStatusCode.misdirectedRequest, HTTPStatusCode(421, phrase: "Misdirected Request")) + XCTAssertEqual(HTTPStatusCode.unprocessableContent, HTTPStatusCode(422, phrase: "Unprocessable Content")) + XCTAssertEqual(HTTPStatusCode.locked, HTTPStatusCode(423, phrase: "Locked")) + XCTAssertEqual(HTTPStatusCode.failedDependency, HTTPStatusCode(424, phrase: "Failed Dependency")) XCTAssertEqual(HTTPStatusCode.tooEarly, HTTPStatusCode(425, phrase: "Too Early")) XCTAssertEqual(HTTPStatusCode.upgradeRequired, HTTPStatusCode(426, phrase: "Upgrade Required")) XCTAssertEqual(HTTPStatusCode.preconditionRequired, HTTPStatusCode(428, phrase: "Precondition Required"))