Skip to content

Commit 02cfa96

Browse files
joshtriplettFishrock123
authored andcommitted
Fix status code 4xx documentation to have the right descriptions
Several paragraphs of documentation had gotten associated with the wrong codes.
1 parent dbe6aec commit 02cfa96

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/status_code.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,38 +149,32 @@ pub enum StatusCode {
149149
/// 400 Bad Request
150150
///
151151
/// The server could not understand the request due to invalid syntax.
152+
BadRequest = 400,
153+
154+
/// 401 Unauthorized
152155
///
153156
/// Although the HTTP standard specifies "unauthorized", semantically this
154157
/// response means "unauthenticated". That is, the client must
155158
/// authenticate itself to get the requested response.
156-
BadRequest = 400,
159+
Unauthorized = 401,
157160

158-
/// 401 Unauthorized
161+
/// 402 Payment Required
159162
///
160163
/// This response code is reserved for future use. The initial aim for
161164
/// creating this code was using it for digital payment systems, however
162165
/// this status code is used very rarely and no standard convention
163166
/// exists.
164-
Unauthorized = 401,
167+
PaymentRequired = 402,
165168

166-
/// 402 Payment Required
169+
/// 403 Forbidden
167170
///
168171
/// The client does not have access rights to the content; that is, it is
169172
/// unauthorized, so the server is refusing to give the requested
170173
/// resource. Unlike 401, the client's identity is known to the server.
171-
PaymentRequired = 402,
172-
173-
/// 403 Forbidden
174-
///
175-
/// The server can not find requested resource. In the browser, this means
176-
/// the URL is not recognized. In an API, this can also mean that the
177-
/// endpoint is valid but the resource itself does not exist. Servers
178-
/// may also send this response instead of 403 to hide the existence of
179-
/// a resource from an unauthorized client. This response code is probably
180-
/// the most famous one due to its frequent occurrence on the web.
181174
Forbidden = 403,
182175

183176
/// 404 Not Found
177+
///
184178
/// The server can not find requested resource. In the browser, this means
185179
/// the URL is not recognized. In an API, this can also mean that the
186180
/// endpoint is valid but the resource itself does not exist. Servers

0 commit comments

Comments
 (0)