Share code to normalize an HTTP method
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Oct 2017 23:35:41 +0000 (23:35 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Oct 2017 23:35:41 +0000 (23:35 +0000)
commit3a7abd9e1a514bca1ee8127a0046f7998d5fbd0a
treec83be8ddd756fcf54c8786b3128922505051845d
parent455cb08c75112dd0844807086fdcfa123de31ffe
Share code to normalize an HTTP method
https://bugs.webkit.org/show_bug.cgi?id=177837

Reviewed by Andy Estes.

Currently we duplicate code in XMLHttpRequest and FetchRequest to normalize an HTTP method.
We should add a common helper function and update both classes to make use of it.

No functionality changed. So, no new tests.

* Modules/fetch/FetchRequest.cpp:
(WebCore::setMethod): Modified to use WebCore::normalizeHTTPMethod().
* platform/network/HTTPParsers.cpp:
(WebCore::normalizeHTTPMethod): Moved from XMLHttpRequest.cpp.
* platform/network/HTTPParsers.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open): Modified to use WebCore::normalizeHTTPMethod().
(WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod): Deleted; moved to HTTPParsers.cpp.
* xml/XMLHttpRequest.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/FetchRequest.cpp
Source/WebCore/platform/network/HTTPParsers.cpp
Source/WebCore/platform/network/HTTPParsers.h
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/XMLHttpRequest.h