Skip to content

Commit 166a37e

Browse files
committed
cleanPath: use path.IsAbs after converting ToSlash
we need a POSIX path filepath.IsAbs can give unexpected results on Windows
1 parent 18dc4db commit 166a37e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

request-server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func cleanPacketPath(pkt *sshFxpRealpathPacket) responsePacket {
232232
// Makes sure we have a clean POSIX (/) absolute path to work with
233233
func cleanPath(p string) string {
234234
p = filepath.ToSlash(p)
235-
if !filepath.IsAbs(p) {
235+
if !path.IsAbs(p) {
236236
p = "/" + p
237237
}
238238
return path.Clean(p)

0 commit comments

Comments
 (0)