refactor: percent-encode cache key subject instead of hex#160
Conversation
cache_key_with_subject hand-rolled hex encoding to make the subject URL-safe. percent_encoding (utf8_percent_encode + PATH_SEGMENT) is already imported in this file and gives the same injective, URL-safe guarantee with shorter keys. Reuse it instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @alukach's task in 22s —— View job ✅ No blocking issues — safe to merge.
|
|
🚀 Latest commit deployed to https://source-data-proxy-pr-160.source-coop.workers.dev
|
What
cache_key_with_subjecthand-rolled hex encoding (subj.bytes().map(|b| format!("{:02x}", b))) to make the subject URL-safe in the cache key. Thepercent_encodingcrate — already imported in this file, with aPATH_SEGMENTset already defined — does the same job.Why
Same guarantee (injective, URL-safe), no hand-rolled encoder, and shorter keys (only non-unreserved bytes get expanded, vs. every byte → 2 hex chars). Reuses tooling the file already pulls in rather than reimplementing it.
Verification
cargo clippy --target wasm32-unknown-unknownclean; full pre-push suite green.utf8_percent_encodereturns aDisplaytype so theformat!key construction is unchanged.Found via ponytail over-engineering audit.
🤖 Generated with Claude Code