We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 719ecfa + 17819e6 commit 1dffa1cCopy full SHA for 1dffa1c
include/crow/middlewares/utf-8.h
@@ -0,0 +1,27 @@
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
14
+ void before_handle(request& /*req*/, response& /*res*/, context& /*ctx*/)
15
16
+ }
17
18
+ void after_handle(request& /*req*/, response& res, context& ctx)
19
20
+ if (get_header_value(res.headers, "Content-Type").empty())
21
22
+ res.set_header("Content-Type", "text/plain; charset=utf-8");
23
24
25
26
27
+}
0 commit comments