From fe4267c77573f2fb6ac50a1dd620d80504238f62 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Sat, 1 Aug 2015 06:39:40 +0300 Subject: [PATCH] Update YaHTTP to v0.1.7 --- ext/yahttp/yahttp/reqresp.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/yahttp/yahttp/reqresp.cpp b/ext/yahttp/yahttp/reqresp.cpp index eee72804b..3dd78483f 100644 --- a/ext/yahttp/yahttp/reqresp.cpp +++ b/ext/yahttp/yahttp/reqresp.cpp @@ -172,8 +172,10 @@ namespace YaHTTP { for(strstr_map_t::const_iterator i = getvars.begin(); i != getvars.end(); i++) { getparmbuf << Utility::encodeURL(i->first, false) << "=" << Utility::encodeURL(i->second, false) << "&"; } - if (getparmbuf.str().length() > 0) - getparms = "?" + std::string(getparmbuf.str().begin(), getparmbuf.str().end() - 1); + if (getparmbuf.str().length() > 0) { + std::string buf = getparmbuf.str(); + getparms = "?" + std::string(buf.begin(), buf.end() - 1); + } else getparms = ""; os << method << " " << url.path << getparms << " HTTP/" << versionStr(this->version); -- 2.40.0