mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-30 18:18:37 -04:00
found problem with unit test of baseUri function, makes code much simpler
This commit is contained in:
parent
fb99d5bb93
commit
b6d8d0f250
4 changed files with 8 additions and 20 deletions
|
@ -276,21 +276,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
|
|||
return baseUri;
|
||||
}
|
||||
|
||||
// window.baseURI isn't emulated by JSdom
|
||||
var loc = window.location;
|
||||
baseUri = loc.href.substring(
|
||||
0,
|
||||
loc.href.length - loc.search.length - loc.hash.length
|
||||
);
|
||||
|
||||
// if base uri contains query string (when no base tag is present),
|
||||
// it is unwanted
|
||||
var queryIndex = baseUri.indexOf('?');
|
||||
if (queryIndex !== -1) {
|
||||
// so we built our own baseuri
|
||||
baseUri = baseUri.substring(0, queryIndex);
|
||||
}
|
||||
|
||||
baseUri = window.location.origin + window.location.pathname;
|
||||
return baseUri;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue