drogon
C++14/17-based HTTP application framework
Loading...
Searching...
No Matches
drogon::plugin::SlashRemover Class Reference

The SlashRemover plugin redirects requests to proper paths if they contain excessive slashes. The json configuration is as follows: More...

#include <drogon/plugins/SlashRemover.h>

Inheritance diagram for drogon::plugin::SlashRemover:
Collaboration diagram for drogon::plugin::SlashRemover:

Public Member Functions

void initAndStart (const Json::Value &config) override
void shutdown () override
Public Member Functions inherited from drogon::PluginBase
void initialize ()
 This method must be called by drogon.
Public Member Functions inherited from drogon::DrObject< SlashRemover >
const std::string & className () const override
 Get the class name.
bool isClass (const std::string &class_name) const override
 Return true if the class name is 'class_name'.

Additional Inherited Members

Static Public Member Functions inherited from drogon::DrObject< SlashRemover >
static const std::string & classTypeName ()

Detailed Description

The SlashRemover plugin redirects requests to proper paths if they contain excessive slashes. The json configuration is as follows:

{
"name": "drogon::plugin::SlashRemover",
"dependencies": ["drogon::plugin::Redirector"],
"config": {
// If true, it removes all trailing slashes, e.g.
"remove_trailing_slashes": true,
// If true, it removes all duplicate slashes, e.g.
"remove_duplicate_slashes": true,
// If true, redirects the request, otherwise forwards
internally.
"redirect": true
}
}

Enable the plugin by adding the configuration to the list of plugins in the configuration file.

Member Function Documentation

◆ initAndStart()

void drogon::plugin::SlashRemover::initAndStart ( const Json::Value & config)
overridevirtual

This method must be called by drogon to initialize and start the plugin. It must be implemented by the user.

Implements drogon::PluginBase.

◆ shutdown()

void drogon::plugin::SlashRemover::shutdown ( )
overridevirtual

This method must be called by drogon to shutdown the plugin. It must be implemented by the user.

Implements drogon::PluginBase.


The documentation for this class was generated from the following file: