100.00% Lines (18/18)
100.00% Functions (3/3)
| TLA | Baseline | Branch | ||||||
|---|---|---|---|---|---|---|---|---|
| Line | Hits | Code | Line | Hits | Code | |||
| 1 | // | 1 | // | |||||
| 2 | // Copyright (c) 2025 Vinnie Falco (vinnie.falco@gmail.com) | 2 | // Copyright (c) 2025 Vinnie Falco (vinnie.falco@gmail.com) | |||||
| 3 | // | 3 | // | |||||
| 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |||||
| 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |||||
| 6 | // | 6 | // | |||||
| 7 | // Official repository: https://github.com/cppalliance/http | 7 | // Official repository: https://github.com/cppalliance/http | |||||
| 8 | // | 8 | // | |||||
| 9 | 9 | |||||||
| 10 | #include <boost/http/server/statuses.hpp> | 10 | #include <boost/http/server/statuses.hpp> | |||||
| 11 | 11 | |||||||
| 12 | namespace boost { | 12 | namespace boost { | |||||
| 13 | namespace http { | 13 | namespace http { | |||||
| 14 | namespace statuses { | 14 | namespace statuses { | |||||
| 15 | 15 | |||||||
| 16 | bool | 16 | bool | |||||
| HITCBC | 17 | 6 | is_empty( unsigned code ) noexcept | 17 | 6 | is_empty( unsigned code ) noexcept | ||
| 18 | { | 18 | { | |||||
| HITCBC | 19 | 6 | switch( code ) | 19 | 6 | switch( code ) | ||
| 20 | { | 20 | { | |||||
| HITCBC | 21 | 3 | case 204: // No Content | 21 | 3 | case 204: // No Content | ||
| 22 | case 205: // Reset Content | 22 | case 205: // Reset Content | |||||
| 23 | case 304: // Not Modified | 23 | case 304: // Not Modified | |||||
| HITCBC | 24 | 3 | return true; | 24 | 3 | return true; | ||
| HITCBC | 25 | 3 | default: | 25 | 3 | default: | ||
| HITCBC | 26 | 3 | return false; | 26 | 3 | return false; | ||
| 27 | } | 27 | } | |||||
| 28 | } | 28 | } | |||||
| 29 | 29 | |||||||
| 30 | bool | 30 | bool | |||||
| HITCBC | 31 | 9 | is_redirect( unsigned code ) noexcept | 31 | 9 | is_redirect( unsigned code ) noexcept | ||
| 32 | { | 32 | { | |||||
| HITCBC | 33 | 9 | switch( code ) | 33 | 9 | switch( code ) | ||
| 34 | { | 34 | { | |||||
| HITCBC | 35 | 6 | case 300: // Multiple Choices | 35 | 6 | case 300: // Multiple Choices | ||
| 36 | case 301: // Moved Permanently | 36 | case 301: // Moved Permanently | |||||
| 37 | case 302: // Found | 37 | case 302: // Found | |||||
| 38 | case 303: // See Other | 38 | case 303: // See Other | |||||
| 39 | case 305: // Use Proxy | 39 | case 305: // Use Proxy | |||||
| 40 | case 307: // Temporary Redirect | 40 | case 307: // Temporary Redirect | |||||
| 41 | case 308: // Permanent Redirect | 41 | case 308: // Permanent Redirect | |||||
| HITCBC | 42 | 6 | return true; | 42 | 6 | return true; | ||
| HITCBC | 43 | 3 | default: | 43 | 3 | default: | ||
| HITCBC | 44 | 3 | return false; | 44 | 3 | return false; | ||
| 45 | } | 45 | } | |||||
| 46 | } | 46 | } | |||||
| 47 | 47 | |||||||
| 48 | bool | 48 | bool | |||||
| HITCBC | 49 | 6 | is_retry( unsigned code ) noexcept | 49 | 6 | is_retry( unsigned code ) noexcept | ||
| 50 | { | 50 | { | |||||
| HITCBC | 51 | 6 | switch( code ) | 51 | 6 | switch( code ) | ||
| 52 | { | 52 | { | |||||
| HITCBC | 53 | 3 | case 502: // Bad Gateway | 53 | 3 | case 502: // Bad Gateway | ||
| 54 | case 503: // Service Unavailable | 54 | case 503: // Service Unavailable | |||||
| 55 | case 504: // Gateway Timeout | 55 | case 504: // Gateway Timeout | |||||
| HITCBC | 56 | 3 | return true; | 56 | 3 | return true; | ||
| HITCBC | 57 | 3 | default: | 57 | 3 | default: | ||
| HITCBC | 58 | 3 | return false; | 58 | 3 | return false; | ||
| 59 | } | 59 | } | |||||
| 60 | } | 60 | } | |||||
| 61 | 61 | |||||||
| 62 | } // statuses | 62 | } // statuses | |||||
| 63 | } // http | 63 | } // http | |||||
| 64 | } // boost | 64 | } // boost | |||||