From 919c347c6dd247faec6b3ae5616c87d91da4b406 Mon Sep 17 00:00:00 2001 From: Carsten Sandtner Date: Tue, 14 May 2013 17:21:27 +0200 Subject: [PATCH] changed method to strip newlines as Android complained. --- scripting/javascript/bindings/XMLHTTPRequest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripting/javascript/bindings/XMLHTTPRequest.cpp b/scripting/javascript/bindings/XMLHTTPRequest.cpp index db7195e6cf..6b3806d491 100644 --- a/scripting/javascript/bindings/XMLHTTPRequest.cpp +++ b/scripting/javascript/bindings/XMLHTTPRequest.cpp @@ -57,7 +57,9 @@ void MinXmlHttpRequest::_gotHeader(string header) { http_value = header.substr(found_header_field+1, header.length()); // Get rid of all \n - http_value.erase(std::remove(http_value.begin(), http_value.end(), '\n'), http_value.end()); + if (!http_value.empty() && http_value[http_value.size() - 1] == '\n') { + http_value.erase(http_value.size() - 1); + } http_header[http_field] = http_value;