mirror of
https://github.com/willnorris/imageproxy.git
synced 2024-12-30 22:34:18 -05:00
rsc.io/grind cleanup
This commit is contained in:
parent
ad54d71881
commit
85e5dcdddc
1 changed files with 2 additions and 1 deletions
3
data.go
3
data.go
|
@ -142,7 +142,7 @@ func (o Options) String() string {
|
||||||
// 100,fv,fh - 100 pixels square, flipped horizontal and vertical
|
// 100,fv,fh - 100 pixels square, flipped horizontal and vertical
|
||||||
// 200x,q80 - 200 pixels wide, proportional height, 80% quality
|
// 200x,q80 - 200 pixels wide, proportional height, 80% quality
|
||||||
func ParseOptions(str string) Options {
|
func ParseOptions(str string) Options {
|
||||||
options := Options{}
|
var options Options
|
||||||
|
|
||||||
for _, opt := range strings.Split(str, ",") {
|
for _, opt := range strings.Split(str, ",") {
|
||||||
switch {
|
switch {
|
||||||
|
@ -212,6 +212,7 @@ func NewRequest(r *http.Request, baseURL *url.URL) (*Request, error) {
|
||||||
return nil, URLError{"too few path segments", r.URL}
|
return nil, URLError{"too few path segments", r.URL}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var err error
|
||||||
req.URL, err = url.Parse(parts[1])
|
req.URL, err = url.Parse(parts[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, URLError{fmt.Sprintf("unable to parse remote URL: %v", err), r.URL}
|
return nil, URLError{fmt.Sprintf("unable to parse remote URL: %v", err), r.URL}
|
||||||
|
|
Loading…
Reference in a new issue