userver: userver/testsuite/middlewares.hpp Source File
Loading...
Searching...
No Matches
middlewares.hpp
1#pragma once
2
3#include <userver/server/middlewares/http_middleware_base.hpp>
4
5USERVER_NAMESPACE_BEGIN
6
7namespace testsuite {
8
9class ExceptionsHandlingMiddleware final
10 : public server::middlewares::HttpMiddlewareBase {
11 public:
12 static constexpr std::string_view kName{
13 "testsuite-exceptions-handling-middleware"};
14
15 explicit ExceptionsHandlingMiddleware(
16 const server::handlers::HttpHandlerBase&) {}
17
18 private:
19 void HandleRequest(server::http::HttpRequest& request,
20 server::request::RequestContext& context) const override;
21};
22
23using ExceptionsHandlingMiddlewareFactory =
24 server::middlewares::SimpleHttpMiddlewareFactory<
25 ExceptionsHandlingMiddleware>;
26
27} // namespace testsuite
28
29USERVER_NAMESPACE_END