From 54926871fc44724e318a47688eaabeabe425be8b Mon Sep 17 00:00:00 2001 From: ExtremesecrecyOne <131911364+ExtremesecrecyOne@users.noreply.github.com> Date: Tue, 22 Jul 2025 16:44:09 -0700 Subject: [PATCH] Uri Change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary Ensured that checking for a query key now returns true when the key is found, allowing accurate existence checks Added “&” separators when reconstructing query strings so that URIs are properly formatted with multiple parameters --- src/Uri.cpp | 1 + src/Uri.hpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Uri.cpp b/src/Uri.cpp index 1219e56..e235b6a 100644 --- a/src/Uri.cpp +++ b/src/Uri.cpp @@ -457,6 +457,7 @@ std::string uri_builder::str() const { s << '?'; for (size_t i = 0; i < queries_.size(); ++i) { + if (i != 0) s << '&'; s << queries_[i].key << "="; HtmlHelper::encode_url_segment(s,queries_[i].value,true); } diff --git a/src/Uri.hpp b/src/Uri.hpp index 52951f8..11ea763 100644 --- a/src/Uri.hpp +++ b/src/Uri.hpp @@ -204,7 +204,7 @@ public: bool has_query(const std::string &key) const { for (size_t i = 0; i < queries_.size(); ++i) { - if (queries_[i].key == key) true; + if (queries_[i].key == key) return true; } return false;