Bug 164907 - Add URL::hostAndPort()
Summary: Add URL::hostAndPort()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-18 00:31 PST by Carlos Garcia Campos
Modified: 2016-11-21 02:04 PST (History)
6 users (show)

See Also:


Attachments
Patch (4.48 KB, patch)
2016-11-18 00:34 PST, Carlos Garcia Campos
achristensen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2016-11-18 00:31:45 PST
As a convenient way of getting the host and port (if any) as a string. This is already needed in a few places.
Comment 1 Carlos Garcia Campos 2016-11-18 00:34:28 PST
Created attachment 295141 [details]
Patch
Comment 2 Alex Christensen 2016-11-18 08:32:01 PST
Comment on attachment 295141 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=295141&action=review

> Source/WebCore/html/URLUtils.h:132
>      if (!url.port() || isDefaultPortForProtocol(url.port().value(), url.protocol()))
>          return url.host();

We can also remove this.  The new URLParser will always remove the port if it's the default port for the protocol.
Same with the check for hostEnd and pathStart.
Comment 3 Carlos Garcia Campos 2016-11-21 02:04:19 PST
Committed r208945: <http://trac.webkit.org/changeset/208945>