(dir, u string)
| 311 | } |
| 312 | |
| 313 | func SafePath(dir, u string) string { |
| 314 | hasSlash := strings.HasPrefix(u, "/") |
| 315 | if hasSlash { |
| 316 | return dir + u[1:] |
| 317 | } else { |
| 318 | return dir + u |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | func RelaPath(base, u string) string { |
| 323 | // 拼接相对目录, 不使用path.join的原因是, 如果存在"////"这样的情况, 可能真的是有意义的路由, 不能随意去掉. |
no outgoing calls
no test coverage detected