Skip to content

Commit

Permalink
fix: 修复上传的文件是URL链接,的判断错误
Browse files Browse the repository at this point in the history
  • Loading branch information
arrebole committed Apr 6, 2023
1 parent 1c8ae75 commit f2c0659
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,9 +721,9 @@ func (sess *Session) Put(localPath, upPath string, workers int) {
}

// 如果需要上传的文件是URL链接
fileURL, err := url.ParseRequestURI(localPath)
if err == nil {
if !contains([]string{"http", "https"}, fileURL.Scheme) || fileURL.Host == "" {
fileURL, _ := url.ParseRequestURI(localPath)
if fileURL.Scheme != "" && fileURL.Host != "" {
if !contains([]string{"http", "https"}, fileURL.Scheme) {
PrintErrorAndExit("Invalid URL %s", localPath)
}

Expand Down

0 comments on commit f2c0659

Please sign in to comment.