Skip to content

Commit 25e0bbb

Browse files
KKuzmichevKKuzmichev
authored andcommitted
Add new reasons/statusCodes/ for HttpResponse
Add new reasons/statusCodes/ for HttpResponse Remove whitespace Again remove whitespace
1 parent 17429fd commit 25e0bbb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

XCode/Sources/HttpResponse.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ public enum HttpResponse {
8383
case ok(HttpResponseBody), created, accepted
8484
case movedPermanently(String)
8585
case movedTemporarily(String)
86-
case badRequest(HttpResponseBody?), unauthorized, forbidden, notFound
86+
case badRequest(HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
87+
case tooManyRequests
8788
case internalServerError
8889
case raw(Int, String, [String:String]?, ((HttpResponseBodyWriter) throws -> Void)? )
8990

@@ -99,6 +100,8 @@ public enum HttpResponse {
99100
case .unauthorized : return 401
100101
case .forbidden : return 403
101102
case .notFound : return 404
103+
case .notAcceptable : return 406
104+
case .tooManyRequests : return 429
102105
case .internalServerError : return 500
103106
case .raw(let code, _, _, _) : return code
104107
}
@@ -116,6 +119,8 @@ public enum HttpResponse {
116119
case .unauthorized : return "Unauthorized"
117120
case .forbidden : return "Forbidden"
118121
case .notFound : return "Not Found"
122+
case .notAcceptable : return "Not Acceptable"
123+
case .tooManyRequests : return "Too Many Requests"
119124
case .internalServerError : return "Internal Server Error"
120125
case .raw(_, let phrase, _, _) : return phrase
121126
}

0 commit comments

Comments
 (0)