Commits

Michael P. Jung committed 0fc4310

Fix consumer.js when included without domain part in URL

This fixes the debug page

Comments (0)

Files changed (1)

opoge/pusher/static/consumer.js

 	function domainFromUrl(url) {
 		var m = url.match(/^https?:\/\/([^:\/]+)/);
 		if (m === null) {
-			throw new Error('Could not parse URL');
+			// Assume an URL without domain part - this is only
+			// useful when the debug page references the consumer.js
+			return document.domain;
 		}
 		return m[1];
 	}