Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
[BUG] 修复某些情况 path 开头包含多个 / 问题
Browse files Browse the repository at this point in the history
  • Loading branch information
4ra1n committed Sep 10, 2024
1 parent 437b62a commit b4c63a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

更新日志:

- [BUG] 修复某些情况 `path` 开头包含多个 `/` 问题
- [优化] 开启 `debug` 时请求响应限制打印长度

感谢以下用户的贡献:
Expand Down
4 changes: 4 additions & 0 deletions rawhttp/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func (c *HTTPClient) buildReqRaw(req *Request) []byte {
}
}

// FIX FINAL PATH
finalPath = strings.TrimLeft(finalPath, "/")
finalPath = "/" + finalPath

buf.WriteString(req.Method + space + finalPath + space + version + lineSep)

var headers []string
Expand Down

0 comments on commit b4c63a6

Please sign in to comment.