summaryrefslogtreecommitdiff
path: root/indra/llcommon/lluri.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/lluri.cpp')
-rw-r--r--indra/llcommon/lluri.cpp42
1 files changed, 24 insertions, 18 deletions
diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp
index 52270376f8..ee14028ec9 100644
--- a/indra/llcommon/lluri.cpp
+++ b/indra/llcommon/lluri.cpp
@@ -218,24 +218,11 @@ LLURI LLURI::buildHTTP(const std::string& prefix,
const LLSD& path,
const LLSD& query)
{
- LLURI result = buildHTTP(prefix, path);
+ LLURI uri = buildHTTP(prefix, path);
+ uri.mEscapedQuery = mapToQueryString(query);
// break out and escape each query component
- if (query.isMap())
- {
- for (LLSD::map_const_iterator it = query.beginMap();
- it != query.endMap();
- it++)
- {
- result.mEscapedQuery += escapeQueryVariable(it->first) +
- (it->second.isUndefined() ? "" : "=" + escapeQueryValue(it->second.asString())) +
- "&";
- }
- if (query.size() > 0)
- {
- result.mEscapedOpaque += "?" + result.mEscapedQuery;
- }
- }
- return result;
+ uri.mEscapedOpaque += "?" + uri.mEscapedQuery ;
+ return uri;
}
// static
@@ -255,7 +242,6 @@ LLURI LLURI::buildHTTP(const std::string& host,
return LLURI::buildHTTP(llformat("%s:%u", host.c_str(), port), path, query);
}
-
namespace {
LLURI buildBackboneURL(LLApp* app,
const std::string& p1 = "",
@@ -507,3 +493,23 @@ LLSD LLURI::queryMap(std::string escaped_query_string)
return result;
}
+std::string LLURI::mapToQueryString(const LLSD& queryMap)
+{
+ std::string query_string;
+
+ if (queryMap.isMap())
+ {
+ for (LLSD::map_const_iterator iter = queryMap.beginMap();
+ iter != queryMap.endMap();
+ iter++)
+ {
+ query_string += escapeQueryVariable(iter->first) +
+ (iter->second.isUndefined() ? "" : "=" + escapeQueryValue(iter->second.asString())) + "&" ;
+ }
+ //if (queryMap.size() > 0)
+ //{
+ // query_string += "?" + query_string ;
+ //}
+ }
+ return query_string;
+}