Changeset 252127 in webkit


Ignore:
Timestamp:
Nov 6, 2019 12:28:28 AM (5 years ago)
Author:
youenn@apple.com
Message:

There is no need to clean the content type header of a request if it is null
https://bugs.webkit.org/show_bug.cgi?id=203853

Reviewed by Geoffrey Garen.

No change of behavior.

  • loader/CrossOriginAccessControl.cpp:

(WebCore::cleanHTTPRequestHeadersForAccessControl):
Stop early if content type is null so that we do not log an error that is not a real error.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r252122 r252127  
     12019-11-06  youenn fablet  <youenn@apple.com>
     2
     3        There is no need to clean the content type header of a request if it is null
     4        https://bugs.webkit.org/show_bug.cgi?id=203853
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        No change of behavior.
     9
     10        * loader/CrossOriginAccessControl.cpp:
     11        (WebCore::cleanHTTPRequestHeadersForAccessControl):
     12        Stop early if content type is null so that we do not log an error that is not a real error.
     13
    1142019-11-05  Ryosuke Niwa  <rniwa@webkit.org>
    215
  • trunk/Source/WebCore/loader/CrossOriginAccessControl.cpp

    r252047 r252127  
    154154{
    155155    // Remove headers that may have been added by the network layer that cause access control to fail.
    156     if (!headersToKeep.contains(HTTPHeadersToKeepFromCleaning::ContentType) && !isCrossOriginSafeRequestHeader(HTTPHeaderName::ContentType, request.httpContentType()))
    157         request.clearHTTPContentType();
     156    if (!headersToKeep.contains(HTTPHeadersToKeepFromCleaning::ContentType)) {
     157        auto contentType = request.httpContentType();
     158        if (!contentType.isNull() && !isCrossOriginSafeRequestHeader(HTTPHeaderName::ContentType, contentType))
     159            request.clearHTTPContentType();
     160    }
    158161    if (!headersToKeep.contains(HTTPHeadersToKeepFromCleaning::Referer))
    159162        request.clearHTTPReferrer();
Note: See TracChangeset for help on using the changeset viewer.