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

Unified Diff: client/internal/lhttp/utils.go

Issue 1159563002: Move retry and lhttp packages from client/internal to common/. (Closed) Base URL: git@github.com:luci/luci-go@master
Patch Set: move-retry-http 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/internal/lhttp/doc.go ('k') | client/internal/lhttp/utils_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/internal/lhttp/utils.go
diff --git a/client/internal/lhttp/utils.go b/client/internal/lhttp/utils.go
deleted file mode 100644
index 222d281d9bbbae94af66d64b05cf11a004f707de..0000000000000000000000000000000000000000
--- a/client/internal/lhttp/utils.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package lhttp
-
-import (
- "errors"
- "net/url"
- "strings"
-)
-
-// URLToHTTPS ensures the url is https://.
-func URLToHTTPS(s string) (string, error) {
- u, err := url.Parse(s)
- if err != nil {
- return "", err
- }
- if u.Scheme != "" && u.Scheme != "https" {
- return "", errors.New("Only https:// scheme is accepted. It can be omitted.")
- }
- if !strings.HasPrefix(s, "https://") {
- s = "https://" + s
- }
- if _, err = url.Parse(s); err != nil {
- return "", err
- }
- return s, nil
-}
« no previous file with comments | « client/internal/lhttp/doc.go ('k') | client/internal/lhttp/utils_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698