check / check (push) Waiting to run
A /v1/image/ URL whose last segment is a size with no format, such as 800x600 or orig, is served as JPEG XL and signed as jxl, so it shares the signature of the same URL ending in .jxl. An encrypted URL whose token holds no format is served as JPEG XL, as encurl.DefaultFormat is now jxl. The generator page selects JPEG XL by default, and a form with an empty format, or none, makes a URL whose name ends in .jxl. The image processor no longer takes an empty format as orig: both routes give every request a format, so it refuses a request with none instead of keeping a second default. auto still ends with JPEG. Model: opus-5-5
22 lines
551 B
Go
22 lines
551 B
Go
package imageprocessor
|
|
|
|
import (
|
|
"bytes"
|
|
"errors"
|
|
"testing"
|
|
)
|
|
|
|
// TestImageProcessor_EmptyFormatRefused verifies that a request with no format
|
|
// is refused, as both image routes give every request a format before it is
|
|
// processed.
|
|
func TestImageProcessor_EmptyFormatRefused(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
_, err := New(Params{}).Process(
|
|
t.Context(), bytes.NewReader(createTestJPEG(t, 20, 20)), &Request{},
|
|
)
|
|
if !errors.Is(err, ErrUnsupportedOutputFormat) {
|
|
t.Errorf("Process() error = %v, want %v", err, ErrUnsupportedOutputFormat)
|
|
}
|
|
}
|