Skip to content

E002 逻辑细化: 空 Profile 处理

背景 context

用户发现一个问题:传入空的 pdf_profile 字符串 (例如 "") 会触发 E002 "Invalid Profile" 错误。 预期的行为是:空 profile 意味着 标准 PDF 生成 (Standard PDF generation),即不需要特定的 PDF/A 合规性,因此不应报错。

变更 Changes

  • 逻辑更新 Logic Update: 在 level_b.rsparallel.rs 中,我们在尝试匹配已知 profiles 之前,先检查 pdf_profile 是否为空或仅包含空格。
  • 行为调整 Behavior:
    • pdf_profile: ""None -> 标准 PDF (成功 Success)。
    • pdf_profile: "pdfa-1b" -> PDF/A-1b (成功 Success)。
    • pdf_profile: "invalid-profile" -> E002 Error (失败 Failure)。

验证 Verification

  • 服务端: 重启于 http://127.0.0.1:6000
  • 测试: 发送带 pdf_profile: "" 的请求现在能成功生成标准 PDF,而此前会返回 E002 错误层。