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

Side by Side Diff: remoting/signaling/jid_util.cc

Issue 1131653002: Use lower-case JIDs when generating signatures for messages sent to CRD bot. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « remoting/signaling/jid_util.h ('k') | remoting/signaling/jid_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "remoting/signaling/jid_util.h"
6
7 #include "base/strings/string_util.h"
8
9 namespace remoting {
10
11 std::string NormalizeJid(const std::string& jid) {
12 size_t slash_pos = jid.find('/');
13
14 // In case there the jid doesn't have resource id covert the whole value to
15 // lower-case.
16 if (slash_pos == std::string::npos)
17 return base::StringToLowerASCII(jid);
18
19 return base::StringToLowerASCII(jid.substr(0, slash_pos)) +
20 jid.substr(slash_pos);
21 }
22
23 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/signaling/jid_util.h ('k') | remoting/signaling/jid_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698