Bug 185266 - [Curl] Enable Proxy Authentication.
Summary: [Curl] Enable Proxy Authentication.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Basuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-03 14:04 PDT by Basuke Suzuki
Modified: 2018-08-27 12:08 PDT (History)
11 users (show)

See Also:


Attachments
PATCH (17.88 KB, patch)
2018-05-03 14:28 PDT, Basuke Suzuki
no flags Details | Formatted Diff | Diff
FIX (18.60 KB, patch)
2018-06-19 12:55 PDT, Basuke Suzuki
achristensen: review+
achristensen: commit-queue-
Details | Formatted Diff | Diff
FIX (18.65 KB, patch)
2018-06-19 15:40 PDT, Basuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Basuke Suzuki 2018-05-03 14:04:38 PDT
Add support for proxy authentication to curl backend.
Comment 1 Basuke Suzuki 2018-05-03 14:28:22 PDT
Created attachment 339467 [details]
PATCH
Comment 2 Don Olmstead 2018-06-13 13:02:34 PDT
Pinging potential reviewers since this has been hanging out for over a month now.
Comment 3 Alex Christensen 2018-06-13 13:23:56 PDT
Comment on attachment 339467 [details]
PATCH

View in context: https://bugs.webkit.org/attachment.cgi?id=339467&action=review

This code is in general a little hard to follow.

> Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp:67
> +int AuthenticationChallenge::getPort(const URL& url)

This should have a better name.  It's not just getting the port.

> Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp:80
> +    auto protocol = url.protocol().toString();
> +    if (protocol == "socks4" || protocol == "socks4a" || protocol == "socks5" || protocol == "socks5h")

We shouldn't need to make a String just to compare it.

> Source/WebCore/platform/network/curl/CurlProxySettings.cpp:75
> +    if (authMethod & CURLAUTH_NTLM)

Should these be else ifs?
Comment 4 Basuke Suzuki 2018-06-14 16:44:53 PDT
Comment on attachment 339467 [details]
PATCH

View in context: https://bugs.webkit.org/attachment.cgi?id=339467&action=review

>> Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp:67
>> +int AuthenticationChallenge::getPort(const URL& url)
> 
> This should have a better name.  It's not just getting the port.

How about determinPortForProxy()?

>> Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp:80
>> +    if (protocol == "socks4" || protocol == "socks4a" || protocol == "socks5" || protocol == "socks5h")
> 
> We shouldn't need to make a String just to compare it.

Of course.

>> Source/WebCore/platform/network/curl/CurlProxySettings.cpp:75
>> +    if (authMethod & CURLAUTH_NTLM)
> 
> Should these be else ifs?

Right.
Comment 5 Basuke Suzuki 2018-06-19 12:55:52 PDT
Created attachment 343088 [details]
FIX

Fixed reviewed points. Also rebased to HEAD.
Comment 6 Alex Christensen 2018-06-19 13:57:25 PDT
Comment on attachment 343088 [details]
FIX

View in context: https://bugs.webkit.org/attachment.cgi?id=343088&action=review

> Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp:68
> +int AuthenticationChallenge::determineProxyPort(const URL& url)

This should return a std::optional<uint16_t>
Comment 7 Basuke Suzuki 2018-06-19 15:40:35 PDT
Created attachment 343116 [details]
FIX

Thanks for r+ > Alex
Comment 8 WebKit Commit Bot 2018-06-19 16:27:04 PDT
Comment on attachment 343116 [details]
FIX

Clearing flags on attachment: 343116

Committed r232992: <https://trac.webkit.org/changeset/232992>
Comment 9 WebKit Commit Bot 2018-06-19 16:27:06 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2018-06-19 16:28:18 PDT
<rdar://problem/41269224>