Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/synchronizer.js

Issue 29339343: Noissue - Removed redundant URL compatibility logic (Closed)
Patch Set: Use hostname Created April 4, 2016, 2:04 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« lib/notification.js ('K') | « lib/notification.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/synchronizer.js
===================================================================
--- a/lib/synchronizer.js
+++ b/lib/synchronizer.js
@@ -206,9 +206,18 @@
// Process parameters
if (params.homepage)
{
- let uri = Utils.makeURI(params.homepage);
- if (uri && (uri.scheme == "http" || uri.scheme == "https"))
- subscription.homepage = uri.spec;
+ let url;
+ try
+ {
+ url = new URL(params.homepage);
+ }
+ catch (e)
+ {
+ url = null;
+ }
+
+ if (url && (url.protocol == "http" || url.protocol == "https"))
+ subscription.homepage = url.href;
}
if (params.title)
« lib/notification.js ('K') | « lib/notification.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld