Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(879)

Side by Side Diff: Source/core/xml/XMLHttpRequest.cpp

Issue 347653003: XMLHttpRequest must build a request using the given method as-is for non-standard types (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update review comments and rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-open-method-case-insensitive-expected.txt ('k') | 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 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org>
4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org>
5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved.
6 * Copyright (C) 2012 Intel Corporation 6 * Copyright (C) 2012 Intel Corporation
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 497
498 bool XMLHttpRequest::isAllowedHTTPMethod(const String& method) 498 bool XMLHttpRequest::isAllowedHTTPMethod(const String& method)
499 { 499 {
500 return !equalIgnoringCase(method, "TRACE") 500 return !equalIgnoringCase(method, "TRACE")
501 && !equalIgnoringCase(method, "TRACK") 501 && !equalIgnoringCase(method, "TRACK")
502 && !equalIgnoringCase(method, "CONNECT"); 502 && !equalIgnoringCase(method, "CONNECT");
503 } 503 }
504 504
505 AtomicString XMLHttpRequest::uppercaseKnownHTTPMethod(const AtomicString& method ) 505 AtomicString XMLHttpRequest::uppercaseKnownHTTPMethod(const AtomicString& method )
506 { 506 {
507 // Valid methods per step-5 of http://xhr.spec.whatwg.org/#the-open()-method .
507 const char* const methods[] = { 508 const char* const methods[] = {
508 "COPY",
509 "DELETE", 509 "DELETE",
510 "GET", 510 "GET",
511 "HEAD", 511 "HEAD",
512 "INDEX",
513 "LOCK",
514 "M-POST",
515 "MKCOL",
516 "MOVE",
517 "OPTIONS", 512 "OPTIONS",
518 "POST", 513 "POST",
519 "PROPFIND", 514 "PUT" };
520 "PROPPATCH", 515
521 "PUT",
522 "UNLOCK" };
523 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(methods); ++i) { 516 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(methods); ++i) {
524 if (equalIgnoringCase(method, methods[i])) { 517 if (equalIgnoringCase(method, methods[i])) {
525 // Don't bother allocating a new string if it's already all uppercas e. 518 // Don't bother allocating a new string if it's already all uppercas e.
526 if (method == methods[i]) 519 if (method == methods[i])
527 return method; 520 return method;
528 return methods[i]; 521 return methods[i];
529 } 522 }
530 } 523 }
531 return method; 524 return method;
532 } 525 }
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 { 1463 {
1471 visitor->trace(m_responseBlob); 1464 visitor->trace(m_responseBlob);
1472 visitor->trace(m_responseStream); 1465 visitor->trace(m_responseStream);
1473 visitor->trace(m_responseDocument); 1466 visitor->trace(m_responseDocument);
1474 visitor->trace(m_progressEventThrottle); 1467 visitor->trace(m_progressEventThrottle);
1475 visitor->trace(m_upload); 1468 visitor->trace(m_upload);
1476 XMLHttpRequestEventTarget::trace(visitor); 1469 XMLHttpRequestEventTarget::trace(visitor);
1477 } 1470 }
1478 1471
1479 } // namespace WebCore 1472 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-open-method-case-insensitive-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698