fix: match actor DNS names case-insensitively at the router - #595
fix: match actor DNS names case-insensitively at the router#595Mesut Oezdil (mesutoezdil) wants to merge 3 commits into
Conversation
DNS lookups are case-insensitive (RFC 4343), so a client that resolves "MyActor.MySpace.actors.resources.substrate.ate.dev" reaches the router with that spelling preserved in Host/:authority. ParseActorDNSName compared it byte for byte against a strictly lower-case suffix and name pattern, so the request was rejected with a 404 even though its DNS lookup had resolved to that very actor. Fold the name to lower case before parsing. Actor and atespace names are always lower case, so a folded name either addresses the same actor its lookup resolved to or fails validation as before.
|
Optional note (AI-generated):
Go converts Consider either rejecting non-ASCII hostnames before lowercasing or lowercasing only ASCII letters A-Z. If an earlier layer already guarantees that hostnames are ASCII, no change may be needed here; this would be defense in depth. |
hm, oki makes sense, i did, ptal |
DNS lookups are case-insensitive (RFC 4343), so a client that resolves
MyActor.MySpace.actors.resources.substrate.ate.devreaches the router with that spelling preserved inHost/:authority(Go's http.Client andcurl -Hboth send the host as written).ParseActorDNSNamecompared it byte for byte against a strictly lower-case suffix and name pattern, so the request was rejected with a 404 byinvalidHostErreven though its DNS lookup had resolved to that very actor.Fold the name to lower case before parsing. Actor and atespace names are always lower case (
ResourceNameRegexPattern), so a folded name either addresses the same actor its lookup resolved to, or fails validation exactly as before.