限制 Raw 图片仅接收八位 PNG

使用 png 解码器读取位深并在 image 解码前拒绝非八位输入。

统一返回稳定的 8-bit PNG 客户端错误并补充十六位 PNG 测试。
This commit is contained in:
2026-09-11 17:48:01 +08:00
parent 99f4961c5f
commit 4c88e5e924
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -240,6 +240,7 @@ dependencies = [
"platform-oss",
"platform-speech",
"platform-wechat",
"png",
"regex",
"reqwest",
"ring",
+1
View File
@@ -87,6 +87,7 @@ http-body-util = "0.1"
httpdate = "1"
hex = "0.4"
image = { version = "0.25", default-features = false }
png = "0.18"
jsonwebtoken = "9"
log = "0.4"
mime_guess = "2.0.5"
+1
View File
@@ -14,6 +14,7 @@ bytes = { workspace = true }
dotenvy = { workspace = true }
hex = { workspace = true }
image = { workspace = true, features = ["jpeg", "png", "webp"] }
png = { workspace = true }
http-body-util = { workspace = true }
reqwest = { workspace = true, features = ["json", "multipart", "rustls-tls"] }
regex = { workspace = true }