File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ pub enum StatusCode {
22
22
NoContent ,
23
23
/// 400, Bad Request
24
24
BadRequest ,
25
+ /// 401, Unauthorized
26
+ Unauthorized ,
25
27
/// 404, Not Found
26
28
NotFound ,
27
29
/// 405, Method Not Allowed
@@ -42,6 +44,7 @@ impl StatusCode {
42
44
Self :: OK => b"200" ,
43
45
Self :: NoContent => b"204" ,
44
46
Self :: BadRequest => b"400" ,
47
+ Self :: Unauthorized => b"401" ,
45
48
Self :: NotFound => b"404" ,
46
49
Self :: MethodNotAllowed => b"405" ,
47
50
Self :: InternalServerError => b"500" ,
@@ -369,6 +372,7 @@ mod tests {
369
372
assert_eq ! ( StatusCode :: OK . raw( ) , b"200" ) ;
370
373
assert_eq ! ( StatusCode :: NoContent . raw( ) , b"204" ) ;
371
374
assert_eq ! ( StatusCode :: BadRequest . raw( ) , b"400" ) ;
375
+ assert_eq ! ( StatusCode :: Unauthorized . raw( ) , b"401" ) ;
372
376
assert_eq ! ( StatusCode :: NotFound . raw( ) , b"404" ) ;
373
377
assert_eq ! ( StatusCode :: MethodNotAllowed . raw( ) , b"405" ) ;
374
378
assert_eq ! ( StatusCode :: InternalServerError . raw( ) , b"500" ) ;
You can’t perform that action at this time.
0 commit comments