aboutsummaryrefslogtreecommitdiff
path: root/modules/httpd.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-14 02:15:38 +0000
committerGravatar Sadie Powell2026-03-14 03:09:11 +0000
commit76f3f24c03c22576324e5af199d3e61d02a79b0d (patch)
treeefa6b9a0295e7b99dc8c0c47c8dd6030238c8cac /modules/httpd.cpp
parentConvert some methods to use string_view. (diff)
Rewrite sepstream and move to stringutils.
Diffstat (limited to 'modules/httpd.cpp')
-rw-r--r--modules/httpd.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/httpd.cpp b/modules/httpd.cpp
index ee8f6eb35..fd63fb29d 100644
--- a/modules/httpd.cpp
+++ b/modules/httpd.cpp
@@ -33,6 +33,7 @@
#include "inspircd.h"
#include "iohook.h"
#include "modules/httpd.h"
+#include "stringutils.h"
#include "utility/string.h"
#ifdef __GNUC__
@@ -347,7 +348,7 @@ public:
{
// Normalise the path.
std::vector<std::string> pathsegments;
- irc::sepstream pathstream(uri.substr(url.field_data[UF_PATH].off, url.field_data[UF_PATH].len), '/');
+ StringSplitter pathstream(uri, '/', true, url.field_data[UF_PATH].off, url.field_data[UF_PATH].len);
for (std::string pathsegment; pathstream.GetToken(pathsegment); )
{
if (pathsegment == ".")
@@ -378,12 +379,10 @@ public:
if (url.field_set & (1 << UF_QUERY))
param_str = uri.substr(url.field_data[UF_QUERY].off, url.field_data[UF_QUERY].len);
- irc::sepstream param_stream(param_str, '&');
- std::string token;
- std::string::size_type eq_pos;
- while (param_stream.GetToken(token))
+ StringSplitter paramstream(param_str, '&');
+ for (std::string_view token; paramstream.GetToken(token); )
{
- eq_pos = token.find('=');
+ const auto eq_pos = token.find('=');
if (eq_pos == std::string::npos)
{
out.query_params.emplace(token, "");