Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
a3ab7164
Commit
a3ab7164
authored
Jun 25, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix download http* $ref links
parent
ee2bc81a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
jsonform.gadget.js
jsonform.gadget.js
+6
-3
No files found.
jsonform.gadget.js
View file @
a3ab7164
...
...
@@ -15,7 +15,9 @@
urn_prefix
=
url
.
slice
(
0
,
urn_prefix
);
url
=
fake_prefix
+
decodeURIComponent
(
url
.
replace
(
urn_prefix
,
""
));
}
if
(
typeof
base_url
===
"
string
"
&&
base_url
.
startsWith
(
"
urn:jio:reference?
"
))
{
if
(
typeof
base_url
===
"
string
"
&&
!
(
url
.
startsWith
(
"
http://
"
)
||
url
.
startsWith
(
"
https://
"
)
||
url
.
startsWith
(
"
//
"
))
&&
base_url
.
startsWith
(
"
urn:jio:reference?
"
))
{
if
(
!
urn_prefix
)
{
urn_prefix
=
base_url
.
indexOf
(
"
?
"
)
+
1
;
urn_prefix
=
base_url
.
slice
(
0
,
urn_prefix
);
...
...
@@ -200,14 +202,15 @@
};
if
(
schema_url_map
.
hasOwnProperty
(
download_url
))
{
url
=
new
URL
(
schema_url_map
[
download_url
],
g
.
__path
);
download_url
=
url
.
origin
+
url
.
pathname
;
}
protocol
=
url
.
protocol
;
if
(
protocol
===
"
http:
"
||
protocol
===
"
https:
"
)
{
if
(
window
.
location
.
protocol
!==
protocol
)
{
throw
new
Error
(
"
You cannot mixed http and https calls
"
);
url
=
new
URL
(
$ref
.
replace
(
protocol
+
"
//
"
,
window
.
location
.
protocol
+
"
//
"
));
// throw new Error("You cannot mixed http and https calls");
}
}
download_url
=
url
.
origin
+
url
.
pathname
;
hash
=
url
.
hash
;
url
=
url
.
href
;
if
(
download_url
.
startsWith
(
"
urn:jio:
"
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment