• David Van Cleve's avatar
    Revert a couple CHECKs on request headers / UA validity · 65aaf056
    David Van Cleve authored
    Out of concern about the compat effects on Android WebView if we change
    its UA string override API to prevent custom headers, revert a couple
    CHECKs added recently to net::HttpRequestHeaders's setters and to
    WebContents's "set the UA override" method. (The consequence is we'll go
    back to a state where we're regularly silently handling a DCHECK
    failure.)
    
    This reverts:
    - f998816 "content: Enforce precondition that UA overrides must..."
    - e98b84ec "net: Change HttpRequestHeaders::SetHeader's DCHECKs to CHECK"
    
    Alternatives considered:
    - extend the network service API to allow privileged clients to append
    arbitrary headers to outgoing requests in order to accommodate the
    WebView case, migrating the WebView UA override setter to use this (too
    much effort)
    - move back to a DCHECK on Android only (saddles //net with platform-
    specific logic with a compat motivation far removed from the network
    stack)
    - keep the CHECKs (could have led to WebView-embedding
    apps crashing in production with unknown frequency)
    
    Fixed: 1105745
    Change-Id: I4423a68f1884da3a9248041f75c800e4803d4e5f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2310774Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
    Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
    Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
    Commit-Queue: David Van Cleve <davidvc@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#790652}
    65aaf056
web_contents_impl.cc 273 KB