summaryrefslogtreecommitdiffstats
path: root/modules/util
diff options
context:
space:
mode:
authorChongyi Zheng <harryzheng25@gmail.com>2023-09-18 04:40:50 -0400
committerGitHub <noreply@github.com>2023-09-18 08:40:50 +0000
commit9631958a82c70f30421fc4e292f700ec8881805e (patch)
tree1aad15400f401170715eec51f725837e3c9263ca /modules/util
parenta50d9af876435d007e6052c6ef8ebc838dd9709f (diff)
downloadgitea-9631958a82c70f30421fc4e292f700ec8881805e.tar.gz
gitea-9631958a82c70f30421fc4e292f700ec8881805e.zip
Refactor lfs requests (#26783)
- Refactor lfs request code - The original code uses `performRequest` function to create the request, uses a callback to modify the request, and then send the request. - Now it's replaced with `createRequest` that only creates request and `performRequest` that only sends the request. - Reuse `createRequest` and `performRequest` in `http_client.go` and `transferadapter.go` --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/util')
-rw-r--r--modules/util/path.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/util/path.go b/modules/util/path.go
index 58258560dd..e8537fb6b9 100644
--- a/modules/util/path.go
+++ b/modules/util/path.go
@@ -225,6 +225,7 @@ func isOSWindows() bool {
var driveLetterRegexp = regexp.MustCompile("/[A-Za-z]:/")
// FileURLToPath extracts the path information from a file://... url.
+// It returns an error only if the URL is not a file URL.
func FileURLToPath(u *url.URL) (string, error) {
if u.Scheme != "file" {
return "", errors.New("URL scheme is not 'file': " + u.String())