⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286971 in webkit


Ignore:
Timestamp:
Dec 13, 2021, 12:29:59 PM (5 years ago)
Author:
Chris Dumez
Message:

Regression(r283565) Unable to report private messages as Spam in Twitter app
https://bugs.webkit.org/show_bug.cgi?id=234253
<rdar://86043227>

Reviewed by Alex Christensen.

Source/WebCore:

Add macro for new linkedOnOrAfter check for sending the Authorization header
on same origin redirects.

  • platform/cocoa/VersionChecks.h:

Source/WebKit:

In r283565, we aligned WebKit's behavior with the Fetch specification and with
Gecko / Blink by keeping the Authorization header on same origin redirects.

However, when reporting a private message in the twitter app, it does a
same-origin redirect from https://twitter.com/account/authenticate_web_view?...
to https://twitter.com/account/authenticate_web_view?... and the HTTP server
reponds with a 401/Unauthorized when we send the Authorization on the post-redirect
request. As far as I can tell, our behavior is correct here and I suspect this is an
issue with the twitter server. As a result, I am simply gating the new behavior
behind a linked-on-or-after check to give twitter a chance to address the issue on
their end.

  • NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:

(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):

Source/WTF:

Add some new iOS / macOS versions.

  • wtf/spi/darwin/dyldSPI.h:
Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r286958 r286971  
     12021-12-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(r283565) Unable to report private messages as Spam in Twitter app
     4        https://bugs.webkit.org/show_bug.cgi?id=234253
     5        <rdar://86043227>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Add some new iOS / macOS versions.
     10
     11        * wtf/spi/darwin/dyldSPI.h:
     12
    1132021-12-13  Elliott Williams  <emw@apple.com>
    214
  • trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h

    r282988 r286971  
    134134#define DYLD_IOS_VERSION_14_5 0x000E0500
    135135#define DYLD_IOS_VERSION_15_0 0x000f0000
     136#define DYLD_IOS_VERSION_15_4 0x000f0400
    136137#define DYLD_IOS_VERSION_16_0 0x00100000
    137138
     
    146147#define DYLD_MACOSX_VERSION_11_3 0x000B0300
    147148#define DYLD_MACOSX_VERSION_12_00 0x000c0000
     149#define DYLD_MACOSX_VERSION_12_3 0x000c0300
    148150#define DYLD_MACOSX_VERSION_13_0 0x000d0000
    149151
  • trunk/Source/WebCore/ChangeLog

    r286970 r286971  
     12021-12-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(r283565) Unable to report private messages as Spam in Twitter app
     4        https://bugs.webkit.org/show_bug.cgi?id=234253
     5        <rdar://86043227>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Add macro for new linkedOnOrAfter check for sending the Authorization header
     10        on same origin redirects.
     11
     12        * platform/cocoa/VersionChecks.h:
     13
    1142021-12-13  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebCore/platform/cocoa/VersionChecks.h

    r282988 r286971  
    7373    FirstWithApplicationCacheDisabledByDefault = DYLD_IOS_VERSION_15_0,
    7474    FirstWithoutExpandoIndexedPropertiesOnWindow = DYLD_IOS_VERSION_15_0,
     75    FirstWithAuthorizationHeaderOnSameOriginRedirects = DYLD_IOS_VERSION_15_4,
    7576    FirstForbiddingDotPrefixedFonts = DYLD_IOS_VERSION_16_0,
    7677#elif PLATFORM(MAC)
     
    100101    FirstWithApplicationCacheDisabledByDefault = DYLD_MACOSX_VERSION_12_00,
    101102    FirstWithoutExpandoIndexedPropertiesOnWindow = DYLD_MACOSX_VERSION_12_00,
     103    FirstWithAuthorizationHeaderOnSameOriginRedirects = DYLD_MACOSX_VERSION_12_3,
    102104    FirstForbiddingDotPrefixedFonts = DYLD_MACOSX_VERSION_13_0,
    103105#endif
  • trunk/Source/WebKit/ChangeLog

    r286961 r286971  
     12021-12-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(r283565) Unable to report private messages as Spam in Twitter app
     4        https://bugs.webkit.org/show_bug.cgi?id=234253
     5        <rdar://86043227>
     6
     7        Reviewed by Alex Christensen.
     8
     9        In r283565, we aligned WebKit's behavior with the Fetch specification and with
     10        Gecko / Blink by keeping the Authorization header on same origin redirects.
     11
     12        However, when reporting a private message in the twitter app, it does a
     13        same-origin redirect from `https://twitter.com/account/authenticate_web_view?...`
     14        to `https://twitter.com/account/authenticate_web_view?...` and the HTTP server
     15        reponds with a 401/Unauthorized when we send the Authorization on the post-redirect
     16        request. As far as I can tell, our behavior is correct here and I suspect this is an
     17        issue with the twitter server. As a result, I am simply gating the new behavior
     18        behind a linked-on-or-after check to give twitter a chance to address the issue on
     19        their end.
     20
     21        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
     22        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
     23
    1242021-12-13  Youenn Fablet  <youenn@apple.com>
    225
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm

    r285565 r286971  
    4242#import <WebCore/ResourceRequest.h>
    4343#import <WebCore/TimingAllowOrigin.h>
     44#import <WebCore/VersionChecks.h>
    4445#import <pal/spi/cf/CFNetworkSPI.h>
    4546#import <wtf/BlockPtr.h>
     
    496497
    497498    } else {
    498         if (auto authorization = m_firstRequest.httpHeaderField(WebCore::HTTPHeaderName::Authorization); !authorization.isNull())
     499        if (auto authorization = m_firstRequest.httpHeaderField(WebCore::HTTPHeaderName::Authorization); !authorization.isNull() && linkedOnOrAfter(WebCore::SDKVersion::FirstWithAuthorizationHeaderOnSameOriginRedirects))
    499500            request.setHTTPHeaderField(WebCore::HTTPHeaderName::Authorization, authorization);
    500501
Note: See TracChangeset for help on using the changeset viewer.