summaryrefslogtreecommitdiff
path: root/chromium/components/database_utils/url_converter.cc
blob: 764bd78886cd9716824cbc3b1336b0b4c93ef42b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/database_utils/url_converter.h"

#include "url/gurl.h"

namespace database_utils {

std::string GurlToDatabaseUrl(const GURL& gurl) {
  // Strip username and password from URL before sending to DB.
  GURL::Replacements replacements;
  replacements.ClearUsername();
  replacements.ClearPassword();
  return (gurl.ReplaceComponents(replacements)).spec();
}

}  // namespace database_utils