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); }, /**