mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Fix the combineUrl function
* Allow a url to omit the protocol and use the same protocol as the * current page
This commit is contained in:
parent
cab5d7b96f
commit
220a8e4f0e
1 changed files with 5 additions and 1 deletions
|
@ -228,7 +228,11 @@ function combineUrl(baseUrl, url) {
|
|||
if (url.charAt(0) == '/') {
|
||||
// absolute path
|
||||
var i = baseUrl.indexOf('://');
|
||||
i = baseUrl.indexOf('/', i + 3);
|
||||
if (url.charAt(1) === '/') {
|
||||
++i;
|
||||
} else {
|
||||
i = baseUrl.indexOf('/', i + 3);
|
||||
}
|
||||
return baseUrl.substring(0, i) + url;
|
||||
} else {
|
||||
// relative path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue