uri_windows.go 275 B

1234567891011121314
  1. //go:build windows
  2. // +build windows
  3. package fasthttp
  4. func addLeadingSlash(dst, src []byte) []byte {
  5. // zero length 、"C:/" and "a" case
  6. isDisk := len(src) > 2 && src[1] == ':'
  7. if len(src) == 0 || (!isDisk && src[0] != '/') {
  8. dst = append(dst, '/')
  9. }
  10. return dst
  11. }