Changeset 151580 in webkit
- Timestamp:
- Jun 13, 2013 9:47:13 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r151579 r151580 1 2013-06-13 Peter Gal <galpeter@inf.u-szeged.hu> 2 3 [curl] Merge http response header values 4 https://bugs.webkit.org/show_bug.cgi?id=117342 5 6 Reviewed by Brent Fulgham. 7 8 According to the HTTP RFC some HTTP header values should be 9 merged if multiple entries for the same header exists. 10 11 * platform/network/curl/ResourceHandleManager.cpp: 12 (WebCore::isAppendableHeader): 13 (WebCore::headerCallback): 14 1 15 2013-06-13 Simon Fraser <simon.fraser@apple.com> 2 16 -
trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp
r151441 r151580 237 237 } 238 238 239 static bool isAppendableHeader(const String &key) 240 { 241 static const char* appendableHeaders[] = { 242 "access-control-allow-headers", 243 "access-control-allow-methods", 244 "access-control-allow-origin", 245 "access-control-expose-headers", 246 "allow", 247 "cache-control", 248 "connection", 249 "content-encoding", 250 "content-language", 251 "if-match", 252 "if-none-match", 253 "keep-alive", 254 "pragma", 255 "proxy-authenticate", 256 "public", 257 "server", 258 "te", 259 "trailer", 260 "transfer-encoding", 261 "upgrade", 262 "user-agent", 263 "vary", 264 "via", 265 "warning", 266 "www-authenticate", 267 0 268 }; 269 270 // Custom headers start with 'X-', and need no further checking. 271 if (key.startsWith("x-", /* caseSensitive */ false)) 272 return true; 273 274 for (unsigned i = 0; appendableHeaders[i]; ++i) 275 if (equalIgnoringCase(key, appendableHeaders[i])) 276 return true; 277 278 return false; 279 } 280 239 281 /* 240 282 * This is being called for each HTTP header in the response. This includes '\r\n' … … 317 359 } else { 318 360 int splitPos = header.find(":"); 319 if (splitPos != -1) 320 d->m_response.setHTTPHeaderField(header.left(splitPos), header.substring(splitPos+1).stripWhiteSpace()); 361 if (splitPos != -1) { 362 String key = header.left(splitPos).stripWhiteSpace(); 363 String value = header.substring(splitPos + 1).stripWhiteSpace(); 364 365 if (isAppendableHeader(key)) 366 d->m_response.addHTTPHeaderField(key, value); 367 else 368 d->m_response.setHTTPHeaderField(key, value); 369 } 321 370 } 322 371
Note: See TracChangeset
for help on using the changeset viewer.