Skip to content

Commit

Permalink
only split URL at first ? in parseURL
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbr committed Oct 9, 2023
1 parent 7337298 commit 9a15e51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/qlever-petrimaps/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,12 +839,12 @@ util::http::Answer Server::handleQueryReq(const Params& pars) const {
// _____________________________________________________________________________
std::string Server::parseUrl(std::string u, std::string pl,
std::map<std::string, std::string>* params) {
auto parts = util::split(u, '?');
auto parts = util::split(u, '?', 2);

if (parts.size() > 1) {
auto kvs = util::split(parts[1], '&');
for (const auto& kv : kvs) {
auto kvp = util::split(kv, '=');
auto kvp = util::split(kv, '=', 2);
if (kvp.size() == 1) kvp.push_back("");
(*params)[util::urlDecode(kvp[0])] = util::urlDecode(kvp[1]);
}
Expand All @@ -853,7 +853,7 @@ std::string Server::parseUrl(std::string u, std::string pl,
// also parse post data
auto kvs = util::split(pl, '&');
for (const auto& kv : kvs) {
auto kvp = util::split(kv, '=');
auto kvp = util::split(kv, '=', 2);
if (kvp.size() == 1) kvp.push_back("");
(*params)[util::urlDecode(kvp[0])] = util::urlDecode(kvp[1]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/util
Submodule util updated 3 files
+2 −0 .gitignore
+13 −1 String.h
+18 −0 tests/TestMain.cpp

0 comments on commit 9a15e51

Please sign in to comment.