From c2ea40b24023e6ecdb8b3860479f7e2db298f76c Mon Sep 17 00:00:00 2001 From: DarthSim Date: Tue, 7 Dec 2021 15:16:59 +0600 Subject: [PATCH] Detect deprecated basic URL format --- CHANGELOG.md | 1 + options/processing_options.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 343b1c7c..f6792267 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] ### Change - Improved ICC profiles handling. +- Proper error message when the deprecated basic URL format is used. ### Fix - (pro) Fix parsing metadata of extended sequential JPEGs. diff --git a/options/processing_options.go b/options/processing_options.go index db19d1c2..091598cb 100644 --- a/options/processing_options.go +++ b/options/processing_options.go @@ -942,6 +942,14 @@ func defaultProcessingOptions(headers http.Header) (*ProcessingOptions, error) { } func parsePathOptions(parts []string, headers http.Header) (*ProcessingOptions, string, error) { + if _, ok := resizeTypes[parts[0]]; ok { + return nil, "", ierrors.New( + 404, + "It looks like you're using the deprecated basic URL format", + "Invalid URL", + ) + } + po, err := defaultProcessingOptions(headers) if err != nil { return nil, "", err