Skip to content

Commit

Permalink
Merge pull request #71 from legalthings/fix-ltritourl
Browse files Browse the repository at this point in the history
Fixes double service in url
  • Loading branch information
svenstm authored Aug 9, 2017
2 parents 217de16 + 7c5e3de commit 3048db5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/ltri-to-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ function ltriToUrl(url) {
var scheme = window.location.protocol + '//';
var host = window.location.host;

base = base.replace(/service\/[a-z]+\//, 'service/');

if (!base.match(/^(https?:)?\/\//)) {
base = host + '/' + base.replace(/^\//, '');
}

url = url.replace('lt:', '');

var auth = url.match(/^[^:\/@]+:[^:\/@]+@/);
if (auth) {
url = url.replace(auth[0], '');
Expand Down

0 comments on commit 3048db5

Please sign in to comment.