From 4e39f9662dba6aaec5c98c6f37b76d6f462ba54c Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Mon, 14 Sep 2015 18:29:39 -0300 Subject: [PATCH] Rewrite origin so it matches original behavior As suggested by @nlalonde --- app/assets/javascripts/discourse/lib/url.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/url.js.es6 b/app/assets/javascripts/discourse/lib/url.js.es6 index b9a56ba4af1..d7231109e11 100644 --- a/app/assets/javascripts/discourse/lib/url.js.es6 +++ b/app/assets/javascripts/discourse/lib/url.js.es6 @@ -271,7 +271,7 @@ const DiscourseURL = Ember.Object.createWithMixins({ // This has been extracted so it can be tested. origin: function() { - return Discourse.BaseUrl + Discourse.BaseUri; + return window.location.origin + (Discourse.BaseUri === "/" ? '' : Discourse.BaseUri); }, /**