Commit fe0cceb
committed
fix(server): canonicalize an IPv6 host extracted from a port-bearing authority
Review follow-up. The bare-literal short-circuit only inspects the raw input.
Once a port is attached it is `urlsplit` that removes the brackets, so the
address reached the rest of the function uncompressed and was never folded:
normalize_host_key("[2001:DB8::0:1]:443") -> "2001:db8::0:1"
normalize_host_key("2001:db8::0:1") -> "2001:db8::1"
So a tenant registered under the bare literal was unreachable from the
equivalent Host value carrying :443, and the idempotency the docstring claims
was simply false -- load-bearing, because InMemorySubdomainTenantRouter
normalizes registration keys at construction and normalizes the Host again at
lookup, so a non-idempotent key fails to match itself.
Re-runs the IP-literal test on the extracted host. Two of the four new tests
fail without this change; the other two are regression guards.
Refs #990.1 parent a2194fb commit fe0cceb
2 files changed
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
504 | 519 | | |
505 | 520 | | |
506 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
0 commit comments