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/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) ------------------ 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); }