mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-11-24 08:12:38 +02:00
Remove redundant URL validation
This commit is contained in:
parent
7104622843
commit
597a8d52c2
@ -11,7 +11,6 @@ import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -136,13 +135,9 @@ func readAndCheckImage(ctx context.Context, res *http.Response) (context.Context
|
||||
}
|
||||
|
||||
func downloadImage(ctx context.Context) (context.Context, context.CancelFunc, error) {
|
||||
imageURL := fmt.Sprintf("%s%s", conf.BaseURL, getImageURL(ctx))
|
||||
url := fmt.Sprintf("%s%s", conf.BaseURL, getImageURL(ctx))
|
||||
|
||||
if _, urlErr := url.ParseRequestURI(imageURL); urlErr != nil {
|
||||
return ctx, func() {}, errInvalidImageURL
|
||||
}
|
||||
|
||||
res, err := downloadClient.Get(imageURL)
|
||||
res, err := downloadClient.Get(url)
|
||||
if err != nil {
|
||||
return ctx, func() {}, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user