From 35359f038f571dc46de3d14af72a2bc911fb0a24 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 18 Mar 2020 22:17:49 +0300 Subject: Implement brep-monitor --- web/server/mime-url-encoding.hxx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 web/server/mime-url-encoding.hxx (limited to 'web/server/mime-url-encoding.hxx') diff --git a/web/server/mime-url-encoding.hxx b/web/server/mime-url-encoding.hxx new file mode 100644 index 0000000..34172a4 --- /dev/null +++ b/web/server/mime-url-encoding.hxx @@ -0,0 +1,32 @@ +// file : web/server/mime-url-encoding.hxx -*- C++ -*- +// license : MIT; see accompanying LICENSE file + +#ifndef WEB_SERVER_MIME_URL_ENCODING_HXX +#define WEB_SERVER_MIME_URL_ENCODING_HXX + +#include + +namespace web +{ + // URL-encode characters other than unreserved (see RFC3986). If the query + // flag is true, then the encoding is applied to the URL query part, and so + // convert space characters to plus characters rather than percent-encode + // them. + // + std::string + mime_url_encode (const char*, bool query = true); + + std::string + mime_url_encode (const std::string&, bool query = true); + + // If the query flag is true, then convert plus characters to space + // characters (see above). Throw std::invalid_argument if an invalid encoding + // sequence is encountered. + // + std::string + mime_url_decode (const char* b, const char* e, + bool trim = false, + bool query = true); +} + +#endif // WEB_SERVER_MIME_URL_ENCODING_HXX -- cgit v1.1