url_converter.cc 574 B

12345678910111213141516171819
  1. // Copyright 2020 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. #include "components/database_utils/url_converter.h"
  5. #include "url/gurl.h"
  6. namespace database_utils {
  7. std::string GurlToDatabaseUrl(const GURL& gurl) {
  8. // Strip username and password from URL before sending to DB.
  9. GURL::Replacements replacements;
  10. replacements.ClearUsername();
  11. replacements.ClearPassword();
  12. return (gurl.ReplaceComponents(replacements)).spec();
  13. }
  14. } // namespace database_utils