summaryrefslogtreecommitdiffstats
path: root/components/search_provider_logos/google_logo_api.cc
diff options
context:
space:
mode:
authornewt <newt@chromium.org>2014-09-24 13:55:08 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-24 20:55:21 +0000
commit673cc76103079eaada968c537c6605dbaf8d909c (patch)
tree917f3e2c7bd454ac46457d154d6ef0d80db9d2b3 /components/search_provider_logos/google_logo_api.cc
parentf53a0a3b2be14a0a56234b2d984ccc4043ec4283 (diff)
downloadchromium_src-673cc76103079eaada968c537c6605dbaf8d909c.zip
chromium_src-673cc76103079eaada968c537c6605dbaf8d909c.tar.gz
chromium_src-673cc76103079eaada968c537c6605dbaf8d909c.tar.bz2
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 Review URL: https://codereview.chromium.org/587943003 Cr-Commit-Position: refs/heads/master@{#296512}
Diffstat (limited to 'components/search_provider_logos/google_logo_api.cc')
-rw-r--r--components/search_provider_logos/google_logo_api.cc18
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(