You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
366 B

1 month ago
  1. "use strict";
  2. function parseHost(urlObj, options)
  3. {
  4. // TWEAK :: condition only for speed optimization
  5. if (options.ignore_www)
  6. {
  7. var host = urlObj.host.full;
  8. if (host)
  9. {
  10. var stripped = host;
  11. if (host.indexOf("www.") === 0)
  12. {
  13. stripped = host.substr(4);
  14. }
  15. urlObj.host.stripped = stripped;
  16. }
  17. }
  18. }
  19. module.exports = parseHost;