Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: jni/AndroidWebRequest.cpp

Issue 5735553819475968: Don't convert header values to lowercase (Closed)
Patch Set: Created Nov. 20, 2013, 1:54 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 if (!jHeaderValue) 245 if (!jHeaderValue)
246 break; 246 break;
247 247
248 std::string headerName = GetString(jniEnv, jHeaderName); 248 std::string headerName = GetString(jniEnv, jHeaderName);
249 std::string headerValue = GetString(jniEnv, jHeaderValue); 249 std::string headerValue = GetString(jniEnv, jHeaderValue);
250 250
251 headerName = TrimString(headerName); 251 headerName = TrimString(headerName);
252 headerValue = TrimString(headerValue); 252 headerValue = TrimString(headerValue);
253 253
254 std::transform(headerName.begin(), headerName.end(), headerName.begin(), : :tolower); 254 std::transform(headerName.begin(), headerName.end(), headerName.begin(), : :tolower);
255 std::transform(headerValue.begin(), headerValue.end(), headerValue.begin() , ::tolower);
256 255
257 result.responseHeaders.push_back(std::pair<std::string, std::string>(heade rName, headerValue)); 256 result.responseHeaders.push_back(std::pair<std::string, std::string>(heade rName, headerValue));
258 257
259 i++; 258 i++;
260 } 259 }
261 D(D_WARN, "Finished downloading"); 260 D(D_WARN, "Finished downloading");
262 261
263 result.status = AdblockPlus::DefaultWebRequest::NS_OK; 262 result.status = AdblockPlus::DefaultWebRequest::NS_OK;
264 } 263 }
265 catch(JavaException& e) 264 catch(JavaException& e)
(...skipping 17 matching lines...) Expand all
283 { 282 {
284 D(D_ERROR, "Unknown exception"); 283 D(D_ERROR, "Unknown exception");
285 result.status = AdblockPlus::DefaultWebRequest::NS_ERROR_FAILURE; 284 result.status = AdblockPlus::DefaultWebRequest::NS_ERROR_FAILURE;
286 } 285 }
287 286
288 if (stat == JNI_EDETACHED) 287 if (stat == JNI_EDETACHED)
289 globalJvm->DetachCurrentThread(); 288 globalJvm->DetachCurrentThread();
290 289
291 return result; 290 return result;
292 } 291 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld