From 6166b44555c52f68b1b1143b41317b088f067d56 Mon Sep 17 00:00:00 2001 From: Evert Pot Date: Fri, 9 Oct 2026 21:29:25 -0400 Subject: [PATCH 1/2] Fix serialization of bytes <= 0xf , they need to be padded by a 0 --- Makefile | 2 +- src/serializer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ffc9f47..9e417b6 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ build: dist/build cjs/index.cjs .PHONY: clean clean: - rm -r dist/ cjs/ + rm -rf dist/ cjs/ test/httpwg-tests .PHONY: test test: lint test/httpwg-tests/list.json dist/build diff --git a/src/serializer.ts b/src/serializer.ts index 27e81d3..88d16f3 100644 --- a/src/serializer.ts +++ b/src/serializer.ts @@ -149,7 +149,7 @@ export function serializeDisplayString(input: DisplayString): string { || char <= 0x1f || char >= 0x7f ) { - out += '%' + char.toString(16); + out += '%' + char.toString(16).padStart(2, '0'); } else { out += String.fromCharCode(char); } From 9a961cd574db7f56af2b911dd51cceb012d91389 Mon Sep 17 00:00:00 2001 From: Evert Pot Date: Fri, 9 Oct 2026 21:31:56 -0400 Subject: [PATCH 2/2] Update changelog --- changelog.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/changelog.md b/changelog.md index f15acbc..6e9369e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,13 @@ ChangeLog ========= +2.1.1 (????-??-??) +------------------ + +* Fix: serialization of displaystring that encodes to byte values under 0xf, + they were missing the 0 padding of %0?. + + 2.1.0 (2026-09-11) ------------------