Skip to content

v1.1.5 — Reject malformed inspect URLs cleanly

Latest

Choose a tag to compare

@vlydev vlydev released this 04 May 12:05

Bug fix: reject malformed inspect URLs cleanly

Real-world URLs from a buggy upstream source arrive truncated mid-keychain with an odd number of hex characters. The library now rejects them with one consistent MalformedInspectLinkException (or equivalent per language) before the binary decode step is even attempted.

What was wrong

  • PHP: hex2bin() emitted an E_WARNING that Symfony escalated to ErrorException (log noise even though the lib already returned false).
  • JS/TS: Buffer.from(oddHex, 'hex') silently truncated odd input — downstream proto parse failed with a cryptic native error or succeeded on garbage.
  • Python/Go/Rust/C#/Kotlin: threw, but with implementation-specific error types leaking through.

What changed

  • Pre-validate hex parity, length, and character set before any binary decode.
  • Wrap proto-decode failures so callers always get the same exception type for "this URL is bad".
  • New exception type extends the previous parent class for backwards compatibility.
  • 9 real-world malformed URLs added as negative test fixtures + synthetic odd-length / empty / non-hex cases.