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

Unified Diff: chrome/browser/autocomplete/search_provider.cc

Issue 289043007: [AiS] Make base64 encoding URL-safe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/search_provider.cc
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index a06fac50988e8643326f8bad50c7402505eefe0f..7a42af1e6ad975664bdff790f41e0d74f7c5a589 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -1152,6 +1152,10 @@ std::string SearchProvider::GetSessionToken() {
std::string raw_data;
base::RandBytes(WriteInto(&raw_data, kTokenBytes + 1), kTokenBytes);
base::Base64Encode(raw_data, &current_token_);
+
+ // Make the base64 encoded value URL and filename safe(see RFC 3548).
+ std::replace(current_token_.begin(), current_token_.end(), '+', '-');
+ std::replace(current_token_.begin(), current_token_.end(), '/', '_');
}
// Extend expiration time another 60 seconds.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698