wx-miniqr-cache

20260916-201504 轮 · 看它的历史
[靶子] clone=h8 port=20098 container=wt_h8_tp8 base=http://localhost:20098
  ✓ 取到两个不同的作品 tplid(实得 15096 / 15097)
  ✓ minted in jnc_ma (uid=990863 corp=1 client_type=50, access TTL 86400s)
  ✓ mint 到 Bearer token(长度 64)

[A] 同一个 tplid 连打两次 → 字节必须逐字相同(改造前实测不同)
  ✓ 清掉该 tplid 的二维码缓存
  ✓ 清掉 token 缓存
  ✓ 冷请求拿到 JPEG(魔数 FFD8,94227 字节)
  ✓ 两次字节 md5 严格相等(c13c56947e27… / c13c56947e27…)
  ✓ Content-Type 严格等于 image/jpeg(实得 "image/jpeg")
  ✓ 缓存命中那次的 Content-Type 也对

[B] 打第二个 id 时不得重新换 token
  ✓ A 之后 token 已进缓存(长度 137)
  ✓ token 缓存 TTL = expires_in-300(实得 6900 秒,期望 (6000, 6900])
  ✓ 第二个 tplid 也拿到 JPEG(97887 字节)
  ✓ token 缓存值逐字未变且非空 = 没有重新换取(长度 137)

[C] 连接超时必须生效(打不可路由地址)
  ✓ 不可达地址返回 null(实得 NULL)
  ✓ 在 6 秒内返回(实得 3.03s,CONNECTTIMEOUT=3)

[D] 鉴权闸还在;已删的 3 个端点都落 404
  ✓ 无 token 仍被鉴权闸拒(实得 {"status":1,"info":"0","data":"token invalid or expired","co)
  ✓ 带 Bearer 拿到 JPEG(94227 字节)
  ✓ /index.php/WxApi/getShopQRCode/shopid/1 → 404(实得 404)
  ✓ /index.php/WxApi/getShopQRCode/shopid/1 落点确实是它自己的 __call(实得 "app\\controller\\WxApi->getShopQRCode")
  ✓ /index.php/WxApi/getShopQRCode/shopid/1 带 no-store(实得 "no-store")
  ✓ /index.php/IndexTB/index_wx_image/id/1 → 404(实得 404)
  ✓ /index.php/IndexTB/index_wx_image/id/1 落点确实是它自己的 __call(实得 "app\\controller\\IndexTB->index_wx_image")
  ✓ /index.php/IndexTB/index_wx_image/id/1 带 no-store(实得 "no-store")
  ✓ /index.php/IndexTB/index_wx_nodeimage/id/1 → 404(实得 404)
  ✓ /index.php/IndexTB/index_wx_nodeimage/id/1 落点确实是它自己的 __call(实得 "app\\controller\\IndexTB->index_wx_nodeimage")
  ✓ /index.php/IndexTB/index_wx_nodeimage/id/1 带 no-store(实得 "no-store")

[E] 存活的同款都改到了,删掉的那些已不存在
  ✓ 存活端点恰好 1 处 wxMiniQrCode((实得 {"getShareQRCode":1})
  ✓ IndexTB 的两个小程序码端点已不存在(实得 {"index_wx_image":0,"index_wx_nodeimage":0})
  ✓ controller 下 cgi-bin/token 字面量归零(实得 0)

[F] appsecret 取不到时必须响亮失败,不挂住、不 500
  ✓ 投毒生效:appsecret 读成空
  ✓ 快速返回(实得 0.03s)= 没有卡在外部调用上
  ✓ 回吐占位图,字节数与磁盘一致(响应 21372 / 磁盘 21372)
  ✓ 占位图是 PNG(魔数 89 50 4E 47)
  ✓ 占位图 Content-Type 严格等于 image/png(实得 "image/png")
  ✓ 已还原 appsecret 读数(长度 32 → 32)

===== PASS=34 FAIL=0 =====