From b5842b264cc73f136abd267cf90d8ddbd4a3230e Mon Sep 17 00:00:00 2001 From: Nova Kwok Date: Wed, 10 Apr 2024 11:11:33 +0800 Subject: [PATCH] Allow jxl based on Accept header (#326) --- config/config.go | 2 +- helper/helper.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 3217f96..6cac3c8 100644 --- a/config/config.go +++ b/config/config.go @@ -49,7 +49,7 @@ var ( ProxyMode bool Prefetch bool Config = NewWebPConfig() - Version = "0.11.0" + Version = "0.11.1" WriteLock = cache.New(5*time.Minute, 10*time.Minute) ConvertLock = cache.New(5*time.Minute, 10*time.Minute) RemoteRaw = "./remote-raw" diff --git a/helper/helper.go b/helper/helper.go index af70917..50a6c33 100644 --- a/helper/helper.go +++ b/helper/helper.go @@ -140,6 +140,9 @@ func GuessSupportedFormat(header *fasthttp.RequestHeader) map[string]bool { if strings.Contains(accept, "image/avif") { supported["avif"] = true } + if strings.Contains(accept, "image/jxl") { + supported["jxl"] = true + } supportedWebPs := []string{"iPhone OS 14", "CPU OS 14", "iPhone OS 15", "CPU OS 15", "iPhone OS 16", "CPU OS 16", "iPhone OS 17", "CPU OS 17"} for _, version := range supportedWebPs {