Skip to content

Commit

Permalink
Update SMNetwork.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
ming1016 committed Jun 6, 2024
1 parent 9390b17 commit b593360
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@ public class SMNetwork {
schemeStr = scheme
hostStr = host
}
url.path()

if urlStr.hasPrefix("http") {
return urlStr
} else {
var slash = ""
if urlStr.hasPrefix("/") == false {
slash = "/"
}
return "\(schemeStr)://\(hostStr)\(slash)\(urlStr)"
// var slash = ""
// if urlStr.hasPrefix("/") == false {
// slash = "/"
// }
return "\(schemeStr)://\(hostStr)\(url.path())\(urlStr)"
}
}
}
Expand Down

0 comments on commit b593360

Please sign in to comment.