Malloy
Toggle main menu visibility
Loading...
Searching...
No Matches
lib
malloy
server
routing
endpoint_http_redirect.hpp
1
#pragma once
2
3
#include "endpoint_http.hpp"
4
#include "../../core/http/utils.hpp"
5
6
namespace
malloy::server
7
{
8
9
struct
endpoint_http_redirect
:
10
endpoint_http
11
{
12
public
:
13
malloy::http::status
status;
14
std::string resource_old;
15
std::string resource_new;
16
17
18
[[nodiscard]]
19
bool
matches
(
const
req_header_t& head)
const override
20
{
21
return
malloy::http::resource_string(head) == resource_old;
22
}
23
24
[[nodiscard]]
25
handle_retr
handle
(
const
req_t&,
const
http::connection_t&)
const override
26
{
27
return
malloy::http::generator::redirect
(status, resource_new);
28
}
29
30
};
31
32
}
malloy::http::generator::redirect
static response redirect(status code, std::string_view location)
Definition
generator.cpp:17
malloy::http::status
boost::beast::http::status status
Definition
types.hpp:23
malloy::server::endpoint_http_redirect
Definition
endpoint_http_redirect.hpp:11
malloy::server::endpoint_http_redirect::handle
handle_retr handle(const req_t &, const http::connection_t &) const override
Definition
endpoint_http_redirect.hpp:25
malloy::server::endpoint_http_redirect::matches
bool matches(const req_header_t &head) const override
Definition
endpoint_http_redirect.hpp:19
Generated by
1.18.0