Skip to content

fix(ssdp): accept standard header tokens and prepare 0.1.3 - #4

Merged
agalwood merged 1 commit into
mainfrom
fix/2_ssdp_header_tokens_20260919
Sep 19, 2026
Merged

agalwood merged 1 commit into
mainfrom
fix/2_ssdp_header_tokens_20260919

Conversation

@agalwood

Copy link
Copy Markdown
Member

Huawei HiLink SSDP responses include HILINK_EXT. The parser rejected the underscore and discarded the entire response, so discovery timed out before fetching the router description.

Accept the complete HTTP field-name token character set from RFC 9110 §5.6.2. Keep the existing ASCII/size limits and private/link-local LOCATION validation. Prepare @motrix/nat 0.1.3, retaining the UDP lifecycle defenses from 0.1.2.

Validation: pnpm run prepublishOnly passes lint, typecheck, 469 tests, and build; four opt-in Docker cases are skipped locally. New regressions cover Huawei's response through WANPPPConnection discovery, all legal token punctuation, invalid delimiters, and public LOCATION rejection. The old negative test now uses an actually invalid character and includes a valid LOCATION to avoid passing for the wrong reason.

Reference: https://www.rfc-editor.org/rfc/rfc9110.html#section-5.6.2

Fixes #2

@agalwood
agalwood merged commit 96b6635 into main Sep 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UPnP discovery always fails on Huawei HiLink routers — SSDP response rejected because header name HILINK_EXT contains underscore

1 participant