drogon
C++14/17-based HTTP application framework
Toggle main menu visibility
Loading...
Searching...
No Matches
SlashRemover.h
Go to the documentation of this file.
1
13
14
#pragma once
15
16
#include "
drogon/plugins/Plugin.h
"
17
#include "drogon/utils/FunctionTraits.h"
18
#include <json/value.h>
19
20
namespace
drogon::plugin
21
{
34
"remove_trailing_slashes": true,
35
// If true, it removes all duplicate slashes, e.g.
37
"remove_duplicate_slashes": true,
38
// If true, redirects the request, otherwise forwards
39
internally.
40
"redirect": true
41
}
42
}
43
@endcode
44
*
45
* Enable the plugin by adding the configuration to the list of plugins in the
46
* configuration file.
47
* */
48
class
DROGON_EXPORT SlashRemover :
public
drogon::Plugin
<SlashRemover>
49
{
50
public
:
51
SlashRemover()
52
{
53
}
54
55
void
initAndStart
(
const
Json::Value &config)
override
;
56
void
shutdown
()
override
;
57
58
private
:
59
bool
trailingSlashes_{
true
}, duplicateSlashes_{
true
}, redirect_{
true
};
60
};
61
}
// namespace drogon::plugin
Plugin.h
drogon::Plugin
The reflection base class for plugins.
Definition
Plugin.h:132
drogon::plugin::SlashRemover::shutdown
void shutdown() override
drogon::plugin::SlashRemover::initAndStart
void initAndStart(const Json::Value &config) override
lib
inc
drogon
plugins
SlashRemover.h
Generated by
1.17.0