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
17  
is_empty( unsigned code ) noexcept
17  
is_empty( unsigned code ) noexcept
18  
{
18  
{
19  
    switch( code )
19  
    switch( code )
20  
    {
20  
    {
21  
    case 204: // No Content
21  
    case 204: // No Content
22  
    case 205: // Reset Content
22  
    case 205: // Reset Content
23  
    case 304: // Not Modified
23  
    case 304: // Not Modified
24  
        return true;
24  
        return true;
25  
    default:
25  
    default:
26  
        return false;
26  
        return false;
27  
    }
27  
    }
28  
}
28  
}
29  

29  

30  
bool
30  
bool
31  
is_redirect( unsigned code ) noexcept
31  
is_redirect( unsigned code ) noexcept
32  
{
32  
{
33  
    switch( code )
33  
    switch( code )
34  
    {
34  
    {
35  
    case 300: // Multiple Choices
35  
    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
42  
        return true;
42  
        return true;
43  
    default:
43  
    default:
44  
        return false;
44  
        return false;
45  
    }
45  
    }
46  
}
46  
}
47  

47  

48  
bool
48  
bool
49  
is_retry( unsigned code ) noexcept
49  
is_retry( unsigned code ) noexcept
50  
{
50  
{
51  
    switch( code )
51  
    switch( code )
52  
    {
52  
    {
53  
    case 502: // Bad Gateway
53  
    case 502: // Bad Gateway
54  
    case 503: // Service Unavailable
54  
    case 503: // Service Unavailable
55  
    case 504: // Gateway Timeout
55  
    case 504: // Gateway Timeout
56  
        return true;
56  
        return true;
57  
    default:
57  
    default:
58  
        return false;
58  
        return false;
59  
    }
59  
    }
60  
}
60  
}
61  

61  

62  
} // statuses
62  
} // statuses
63  
} // http
63  
} // http
64  
} // boost
64  
} // boost