Skip to content

Add boundary tests for host rewrite bare-host substitution #449

@prk-Jr

Description

@prk-Jr

Description

rewrite_bare_host_at_boundaries in crates/common/src/host_rewrite.rs has complex boundary detection logic and no direct tests. This leaves host rewriting vulnerable to regressions around subdomains, punctuation, word boundaries, and host:port forms.

Done when

  • Add unit tests for exact host matches at valid boundaries.
  • Add negative tests for subdomains and embedded-word partial matches.
  • Add coverage for multiple occurrences, empty input, and host:port cases.
  • Keep the test names focused on rewrite semantics rather than implementation details.

Affected area

  • HTML processing / JS injection

Additional context

Source: test_gap.md, section URL Rewriting Boundary Detection.
Parent issue: #396

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions