Crow
1.1
A C++ microframework for the web
utf-8.h
1
#pragma once
2
#include "crow/http_request.h"
3
#include "crow/http_response.h"
4
5
namespace
crow
6
{
7
8
struct
UTF8
9
{
10
struct
context
11
{};
12
13
void
before_handle(
request
&
/*req*/
,
response
&
/*res*/
,
context
&
/*ctx*/
)
14
{}
15
16
void
after_handle(
request
&
/*req*/
,
response
& res, context&
/*ctx*/
)
17
{
18
if
(get_header_value(res.
headers
,
"Content-Type"
).empty())
19
{
20
res.
set_header
(
"Content-Type"
,
"text/plain; charset=utf-8"
);
21
}
22
}
23
};
24
25
}
// namespace crow
crow::UTF8::context
Definition:
utf-8.h:11
crow::UTF8
Definition:
utf-8.h:9
crow::request
An HTTP request.
Definition:
http_request.h:28
crow::response
HTTP response.
Definition:
http_response.h:34
crow::response::set_header
void set_header(std::string key, std::string value)
Set the value of an existing header in the response.
Definition:
http_response.h:51
crow::response::headers
ci_map headers
HTTP headers.
Definition:
http_response.h:42
include
crow
middlewares
utf-8.h
Generated on Tue Mar 19 2024 for Crow by
1.9.1. Dark theme by
Tilen Majerle
. Edited by
Farook Al-Sammarraie
. All rights reserved.