Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bff1e092438a6e16c0304ec50a6f7517f8bc54bb
      
https://github.com/WebKit/WebKit/commit/bff1e092438a6e16c0304ec50a6f7517f8bc54bb
  Author: Anne van Kesteren <[email protected]>
  Date:   2026-07-16 (Thu, 16 Jul 2026)

  Changed paths:
    M Source/WTF/wtf/URLHelpers.cpp
    M Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm

  Log Message:
  -----------
  mapHostNames misparses a colon in userinfo as the port separator
https://bugs.webkit.org/show_bug.cgi?id=314919
rdar://177742288

Reviewed by Alex Christensen.

applyHostNameFunctionToURLString found the host name's terminator (the
first ":", "/", "?", or "#") before looking for the userinfo "@". For a
URL like "https://user:pass@münchen.de/"; the ":" in the userinfo was
taken as the port separator, so the "@" fell outside the searched range
and "user" was mapped as the host instead of "münchen.de", leaving the
real host without IDN processing.

Find the authority end ("/", "?", "#", or end of string) first, then the
last "@" within it, and only then the ":" port separator. This also lets
IPv6 literals with a port or userinfo pass through correctly.

Test: Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm
Canonical link: https://commits.webkit.org/317346@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to