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 {
2222 NoContent ,
2323 /// 400, Bad Request
2424 BadRequest ,
25+ /// 401, Unauthorized
26+ Unauthorized ,
2527 /// 404, Not Found
2628 NotFound ,
2729 /// 405, Method Not Allowed
@@ -42,6 +44,7 @@ impl StatusCode {
4244 Self :: OK => b"200" ,
4345 Self :: NoContent => b"204" ,
4446 Self :: BadRequest => b"400" ,
47+ Self :: Unauthorized => b"401" ,
4548 Self :: NotFound => b"404" ,
4649 Self :: MethodNotAllowed => b"405" ,
4750 Self :: InternalServerError => b"500" ,
@@ -369,6 +372,7 @@ mod tests {
369372 assert_eq ! ( StatusCode :: OK . raw( ) , b"200" ) ;
370373 assert_eq ! ( StatusCode :: NoContent . raw( ) , b"204" ) ;
371374 assert_eq ! ( StatusCode :: BadRequest . raw( ) , b"400" ) ;
375+ assert_eq ! ( StatusCode :: Unauthorized . raw( ) , b"401" ) ;
372376 assert_eq ! ( StatusCode :: NotFound . raw( ) , b"404" ) ;
373377 assert_eq ! ( StatusCode :: MethodNotAllowed . raw( ) , b"405" ) ;
374378 assert_eq ! ( StatusCode :: InternalServerError . raw( ) , b"500" ) ;
You can’t perform that action at this time.
0 commit comments