userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
handler_config.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/server/handlers/handler_config.hpp
4
/// @brief HTTP handler static configuration
5
6
#
include
<
optional
>
7
#
include
<
string
>
8
#
include
<
variant
>
9
#
include
<
vector
>
10
11
#
include
<
userver
/
server
/
handlers
/
auth
/
handler_auth_config
.
hpp
>
12
#
include
<
userver
/
server
/
handlers
/
fallback_handlers
.
hpp
>
13
#
include
<
userver
/
server
/
http
/
http_status
.
hpp
>
14
#
include
<
userver
/
server
/
request
/
request_config
.
hpp
>
15
16
USERVER_NAMESPACE_BEGIN
17
18
namespace
server {
19
struct
ServerConfig;
20
}
// namespace server
21
22
namespace
server::
handlers
{
23
24
/// Defines matching behavior for paths with trailing slashes.
25
enum
class
UrlTrailingSlashOption
{
26
kBoth
,
///< ignore trailing slashes when matching paths
27
kStrictMatch
,
///< require exact match for trailing slashes in paths
28
29
kDefault =
kBoth
,
30
};
31
32
struct
HandlerConfig
{
33
/// Either a path pattern of the handler that may contain path-argument placeholders, or a fallback handler
34
std::variant<std::string, FallbackHandler>
path
;
35
std::optional<std::string> task_processor;
36
std::string method;
37
request
::
HttpRequestConfig
request_config{};
38
size_t request_body_size_log_limit{0};
39
size_t request_headers_size_log_limit{0};
40
size_t response_data_size_log_limit{0};
41
std::optional<auth::HandlerAuthConfig> auth;
42
UrlTrailingSlashOption
url_trailing_slash{
UrlTrailingSlashOption
::kDefault};
43
std::optional<size_t> max_requests_in_flight;
44
std::optional<size_t> max_requests_per_second;
45
bool
decompress_request{
true
};
46
bool
throttling_enabled{
true
};
47
bool
response_body_stream{
false
};
48
std::optional<
bool
> set_response_server_hostname;
49
bool
set_tracing_headers{
true
};
50
bool
deadline_propagation_enabled{
true
};
51
bool
deadline_propagation_prefer_timestamp{
false
};
52
bool
enable_write_statistics{
true
};
53
http
::
HttpStatus
deadline_expired_status_code{498};
54
};
55
56
HandlerConfig
ParseHandlerConfigsWithDefaults(
57
const
yaml_config
::
YamlConfig
& value,
58
const
server::ServerConfig& server_config,
59
bool
is_monitor =
false
60
);
61
62
}
// namespace server::handlers
63
64
USERVER_NAMESPACE_END
userver
server
handlers
handler_config.hpp
Generated on
for userver by
Doxygen
1.17.0