mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-13 22:12:40 +02:00
Fixed lint error
This commit is contained in:
parent
ec264026c9
commit
9b678fda97
1 changed files with 7 additions and 2 deletions
9
data.go
9
data.go
|
|
@ -340,8 +340,13 @@ func NewRequest(r *http.Request, baseURL *url.URL) (*Request, error) {
|
||||||
var additionalQuery string
|
var additionalQuery string
|
||||||
req := &Request{Original: r}
|
req := &Request{Original: r}
|
||||||
|
|
||||||
path := r.URL.EscapedPath()[1:] // the image url is stored in the path, so get image url from path but strip leading slash so it's not like /https://example.com
|
path := r.URL.EscapedPath()[1:] // the image url is stored in the path, so get image url from path but strip leading slash so it's not like /https://example.com
|
||||||
path, err, additionalQuery = decodeURL(path) // Conditionally decode url path param if it is url encoded this enables us to process image urls with query params built in
|
|
||||||
|
decodedPath, err, additionalQuery := decodeURL(path) // Conditionally decode url path param if it is url encoded this enables us to process image urls with query params built in
|
||||||
|
if err == nil {
|
||||||
|
path = decodedPath
|
||||||
|
}
|
||||||
|
|
||||||
req.URL, err = parseURL(path)
|
req.URL, err = parseURL(path)
|
||||||
|
|
||||||
if err != nil || !req.URL.IsAbs() {
|
if err != nil || !req.URL.IsAbs() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue