Escape URL

This commit is contained in:
Christoph Polcin
2018-05-23 13:41:06 +02:00
parent c49c91989e
commit 375f391c8a
4 changed files with 54 additions and 8 deletions

View File

@@ -8,9 +8,7 @@ import (
)
func (c *Client) req(method, path string, body io.Reader, intercept func(*http.Request)) (req *http.Response, err error) {
path = strings.Replace(path, "%", "%25", -1)
path = strings.Replace(path, "#", "%23", -1)
r, err := http.NewRequest(method, Join(c.root, path), body)
r, err := http.NewRequest(method, PathEscape(Join(c.root, path)), body)
if err != nil {
return nil, err
}