summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@linux.intel.com>2018-10-16 15:19:20 -0700
committerEd Tanous <ed.tanous@intel.com>2018-10-19 20:22:55 +0000
commit43fcbe55bc0917f0bf4a2eaab14dcfbfaf4f9119 (patch)
tree5bef56c47c8b70704f100c7892ed47e55d35dbcc
parente1f26343d52c4ea8b4c491f4323744d72b34e6ba (diff)
downloadbmcweb-43fcbe55bc0917f0bf4a2eaab14dcfbfaf4f9119.tar.gz
bmcweb-43fcbe55bc0917f0bf4a2eaab14dcfbfaf4f9119.zip
Fix URL query parameter parsing
This change makes some minor corrections requried to properly parse query parameters in the url. Tested: Checked that parsing is working properly by using redfish $skip and $top parameters and values and confirming the values are correctly available in redfish. Change-Id: If95838cf0d4a1044059d3ca2630c8e3640b1f558 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
-rw-r--r--crow/include/crow/http_connection.h2
-rw-r--r--crow/include/crow/query_string.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/crow/include/crow/http_connection.h b/crow/include/crow/http_connection.h
index 6d62c85..2c6a28d 100644
--- a/crow/include/crow/http_connection.h
+++ b/crow/include/crow/http_connection.h
@@ -505,7 +505,7 @@ class Connection
std::size_t index = req->url.find("?");
if (index != boost::string_view::npos)
{
- req->url = req->url.substr(0, index - 1);
+ req->url = req->url.substr(0, index);
}
req->urlParams = QueryString(std::string(req->target()));
doRead();
diff --git a/crow/include/crow/query_string.h b/crow/include/crow/query_string.h
index 67e426a..553960e 100644
--- a/crow/include/crow/query_string.h
+++ b/crow/include/crow/query_string.h
@@ -344,7 +344,7 @@ class QueryString
return *this;
}
- explicit QueryString(std::string url) : url(std::move(url))
+ explicit QueryString(std::string newUrl) : url(std::move(newUrl))
{
if (url.empty())
{
OpenPOWER on IntegriCloud