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