Fix build with vips <8.6; More verbose "unsupported" errors

This commit is contained in:
DarthSim
2019-09-20 14:25:37 +06:00
parent 4984287918
commit d844b4eea9
2 changed files with 14 additions and 14 deletions

View File

@@ -237,9 +237,9 @@ func decodeBase64URL(parts []string) (string, string, error) {
fullURL := fmt.Sprintf("%s%s", conf.BaseURL, string(imageURL))
if _, err := url.ParseRequestURI(fullURL); err != nil {
return "", "", fmt.Errorf("Invalid image url: %s", fullURL)
}
// if _, err := url.ParseRequestURI(fullURL); err != nil {
// return "", "", fmt.Errorf("Invalid image url: %s", fullURL)
// }
return fullURL, format, nil
}
@@ -269,9 +269,9 @@ func decodePlainURL(parts []string) (string, string, error) {
fullURL := fmt.Sprintf("%s%s", conf.BaseURL, unescaped)
if _, err := url.ParseRequestURI(fullURL); err != nil {
return "", "", fmt.Errorf("Invalid image url: %s", fullURL)
}
// if _, err := url.ParseRequestURI(fullURL); err != nil {
// return "", "", fmt.Errorf("Invalid image url: %s", fullURL)
// }
return fullURL, format, nil
}