Opened 18 months ago

Last modified 13 months ago

#7296 closed change

Implement hostname extraction using a regular expression — at Version 2

Reported by: mjethani Assignee:
Priority: P2 Milestone:
Module: Core Keywords:
Cc: greiner Blocked By:
Blocking: #7000 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

Description (last modified by mjethani)


In the extension we use the URL object just to extract the hostname from a URL. This is not very efficient as it must parse the entire URL. Extraction of the hostname can be implemented using a regular expression instead:

let [, hostname] = /(?:[^:]+:)(?:\/\/(?:[^\/]*@)?(\[[^\]]*\]|[^:\/]+))?/.exec(url) || [];

What to change

To be determined.

Change History (2)

comment:1 Changed 18 months ago by mjethani

  • Blocking 7000 added

comment:2 Changed 18 months ago by mjethani

  • Description modified (diff)
Note: See TracTickets for help on using tickets.