diff options
author | newt <newt@chromium.org> | 2014-09-24 16:21:15 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-24 23:21:31 +0000 |
commit | ac852f9a9158369fd38fed3d29d9329596e1036a (patch) | |
tree | cee8b884593bd4c521bdfba922fbc66873152694 /components/search_provider_logos/google_logo_api.cc | |
parent | ba5d32190d4f056b11738b050b94895b655c52f7 (diff) | |
download | chromium_src-ac852f9a9158369fd38fed3d29d9329596e1036a.zip chromium_src-ac852f9a9158369fd38fed3d29d9329596e1036a.tar.gz chromium_src-ac852f9a9158369fd38fed3d29d9329596e1036a.tar.bz2 |
Revert of Revert of Fix doodle verification URL. (patchset #1 id:1 of https://codereview.chromium.org/599243002/)
Reason for revert:
The original revert was a mistake. Relanding this with no changed.
Original issue's description:
> Revert of Fix doodle verification URL. (patchset #3 id:40001 of https://codereview.chromium.org/587943003/)
>
> Reason for revert:
> Caused test failure:
> http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%283%29/builds/7944
>
> Original issue's description:
> > Fix doodle verification URL.
> >
> > When verifying that the cached doodle is still valid, we load the doodle
> > URL and append the query param "async=es_dfp:<fingerprint>". Previously,
> > the ":" was being escape to "%3A", causing the server to respond with a
> > 400 error. This mollifies the server by keeping the colon unescaped.
> >
> > BUG=413845
> >
> > Committed: https://crrev.com/673cc76103079eaada968c537c6605dbaf8d909c
> > Cr-Commit-Position: refs/heads/master@{#296512}
>
> TBR=justincohen@chromium.org,rsleevi@chromium.org,mmenke@chromium.org,newt@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> BUG=413845
>
> Committed: https://crrev.com/6101b6321585a402ffc7c45dbb4fc61bc36f0051
> Cr-Commit-Position: refs/heads/master@{#296546}
TBR=justincohen@chromium.org,rsleevi@chromium.org,mmenke@chromium.org,groby@chromium.org,jiayl@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=413845
Review URL: https://codereview.chromium.org/606443004
Cr-Commit-Position: refs/heads/master@{#296556}
Diffstat (limited to 'components/search_provider_logos/google_logo_api.cc')
-rw-r--r-- | components/search_provider_logos/google_logo_api.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/components/search_provider_logos/google_logo_api.cc b/components/search_provider_logos/google_logo_api.cc index 9a855cb..1c81bfe 100644 --- a/components/search_provider_logos/google_logo_api.cc +++ b/components/search_provider_logos/google_logo_api.cc @@ -9,7 +9,6 @@ #include "base/memory/ref_counted_memory.h" #include "base/strings/string_util.h" #include "base/values.h" -#include "net/base/url_util.h" namespace search_provider_logos { @@ -19,7 +18,22 @@ const char kResponsePreamble[] = ")]}'"; GURL GoogleAppendFingerprintToLogoURL(const GURL& logo_url, const std::string& fingerprint) { - return net::AppendQueryParameter(logo_url, "async", "es_dfp:" + fingerprint); + // Note: we can't just use net::AppendQueryParameter() because it escapes + // ":" to "%3A", but the server requires the colon not to be escaped. + // See: http://crbug.com/413845 + + // TODO(newt): Switch to using net::AppendQueryParameter once it no longer + // escapes ":" + + std::string query(logo_url.query()); + if (!query.empty()) + query += "&"; + + query += "async=es_dfp:"; + query += fingerprint; + GURL::Replacements replacements; + replacements.SetQueryStr(query); + return logo_url.ReplaceComponents(replacements); } scoped_ptr<EncodedLogo> GoogleParseLogoResponse( |