diff options
author | Aleksandr Razumov <ar@cydev.ru> | 2016-05-04 10:07:11 +0300 |
---|---|---|
committer | Aleksandr Razumov <ar@cydev.ru> | 2016-05-04 10:07:11 +0300 |
commit | 5e1bdcae2d7909e455675a34a157119a30765672 (patch) | |
tree | 3fd32ad5f3e5c9fa8d64bb8622637adcb948cf50 /uri_unix.go | |
parent | Issue #83: Added ResponseHeader.DelClientCookie for instructing the client fo... (diff) | |
download | fasthttp-5e1bdcae2d7909e455675a34a157119a30765672.tar.gz fasthttp-5e1bdcae2d7909e455675a34a157119a30765672.tar.bz2 fasthttp-5e1bdcae2d7909e455675a34a157119a30765672.zip |
Issue #86: Fixed leading slash on Windows
Diffstat (limited to 'uri_unix.go')
-rw-r--r-- | uri_unix.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/uri_unix.go b/uri_unix.go new file mode 100644 index 0000000..631712a --- /dev/null +++ b/uri_unix.go @@ -0,0 +1,15 @@ +// +build !windows + +package fasthttp + +import "bytes" + + +func addLeadingSlash(dst, src []byte) []byte { + // add leading slash for unix paths + if len(src) == 0 || src[0] != '/' { + dst = append(dst, '/') + } + + return dst +} |