Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Issue 6312088: Fix handling of setting a single proxy in Proxy Settings API (Closed)

Created:
9 years, 10 months ago by battre
Modified:
9 years, 7 months ago
Reviewers:
eroman
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Fix handling of setting a single proxy in Proxy Settings API Previously, setting a singleProxy entry in the Proxy Settings API meant that we set http, https, and ftp proxies individually. I.e. the Proxy settings was "http=http://foo;https=https://foo;ftp=ftp://foo". With this change it becomes "foo". BUG=67779 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=74286

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -29 lines) Patch
M chrome/browser/extensions/extension_proxy_api.cc View 2 chunks +23 lines, -11 lines 1 comment Download
M chrome/browser/extensions/extension_proxy_apitest.cc View 1 chunk +1 line, -4 lines 0 comments Download
M chrome/test/data/extensions/api_test/proxy/single/test.js View 1 chunk +1 line, -14 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
battre
Please review or dispatch to another reviewer. Thanks.
9 years, 10 months ago (2011-02-02 12:35:50 UTC) #1
eroman
9 years, 10 months ago (2011-02-08 01:11:07 UTC) #2
LGTM.

I think I see a bug in the forming of host:port strings, however feel free to
address that as a separate changelist, doesn't need to block this one.

http://codereview.chromium.org/6312088/diff/1/chrome/browser/extensions/exten...
File chrome/browser/extensions/extension_proxy_api.cc (right):

http://codereview.chromium.org/6312088/diff/1/chrome/browser/extensions/exten...
chrome/browser/extensions/extension_proxy_api.cc:193: proxy_pref.append(":");
It is not generally safe to form host:port pairs simply by concatenating
hostname and ports.

Can you use net::ProxyServer here instead?

A specific case which won't work is IPv6 literals.
Unfortunatly in IPv6, colon is a possible character in the IP address.

So if the host was say ::1 and the port was "80", it would be wrong to form the
concatenated destination as ::1:80. Instead the IPv6 literal needs to be
enclosed in square brackets:

[::1]:80

To avoid these problems, we use HostAndPortPair::ToString() to form the correct
string in cases when the hostname is an IP literal.

I realize that problem is not new with this change, but the new code seems to be
continuing the same problem.

I am ok with handling this issue separately (don't need to do it as part of this
CL).

Powered by Google App Engine
This is Rietveld 408576698