uri_windows.go 237 B

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