Skip to main content
Homepage
Explore
Search or go to…
/
Sign in
Explore
Primary navigation
Project
A
api-connection
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Coscine
frontend
libraries
api-connection
Commits
3c64bf52
This project is archived. Its data is
read-only
.
Commit
3c64bf52
authored
Aug 20, 2020
by
Benedikt Heinrichs
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Send correct path (coscine/issues#1004)
parent
c31c4971
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!81
Hotfix/988-fixSpecialCharacters
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/basic/api-connection-basic.ts
+14
-0
14 additions, 0 deletions
src/basic/api-connection-basic.ts
src/requests/blob-api.ts
+3
-3
3 additions, 3 deletions
src/requests/blob-api.ts
src/requests/tree-api.ts
+2
-17
2 additions, 17 deletions
src/requests/tree-api.ts
with
19 additions
and
20 deletions
src/basic/api-connection-basic.ts
+
14
−
0
View file @
3c64bf52
...
...
@@ -14,6 +14,20 @@ export default {
}
return
hostName
;
},
preparePath
(
path
:
string
)
{
let
resultString
=
''
;
if
(
path
.
charAt
(
0
)
===
'
/
'
)
{
path
=
path
.
substring
(
1
);
}
let
array
=
path
.
split
(
'
/
'
);
for
(
let
i
=
0
;
i
<
array
.
length
;
i
++
)
{
resultString
+=
encodeURIComponent
(
array
[
i
]);
if
(
i
!==
array
.
length
-
1
)
{
resultString
+=
'
/
'
;
}
}
return
resultString
;
},
setHeader
()
{
axios
.
defaults
.
headers
.
common
[
authHeaderKey
]
=
'
Bearer
'
+
(
coscine
as
any
).
authorization
.
bearer
;
...
...
...
...
This diff is collapsed.
Click to expand it.
src/requests/blob-api.ts
+
3
−
3
View file @
3c64bf52
...
...
@@ -37,7 +37,7 @@ export class BlobApi {
)
{
apiConnectionBasic
.
setHeader
();
return
axios
.
get
(
getBlobApiUrl
()
+
resourceId
+
'
/
'
+
encodeURIComponent
(
path
),
{
.
get
(
getBlobApiUrl
()
+
resourceId
+
'
/
'
+
apiConnectionBasic
.
preparePath
(
path
),
{
responseType
:
'
blob
'
})
.
then
(
thenHandler
)
...
...
@@ -52,7 +52,7 @@ export class BlobApi {
)
{
apiConnectionBasic
.
setHeader
();
return
axios
.
delete
(
getBlobApiUrl
()
+
resourceId
+
'
/
'
+
encodeURIComponent
(
path
))
.
delete
(
getBlobApiUrl
()
+
resourceId
+
'
/
'
+
apiConnectionBasic
.
preparePath
(
path
))
.
then
(
thenHandler
)
.
catch
(
catchHandler
);
}
...
...
@@ -68,7 +68,7 @@ export class BlobApi {
apiConnectionBasic
.
setHeader
();
return
axios
({
method
:
'
PUT
'
,
url
:
getBlobApiUrl
()
+
resourceId
+
'
/
'
+
encodeURIComponent
(
path
),
url
:
getBlobApiUrl
()
+
resourceId
+
'
/
'
+
apiConnectionBasic
.
preparePath
(
path
),
headers
:
{
'
Content-Type
'
:
mimetype
},
...
...
...
...
This diff is collapsed.
Click to expand it.
src/requests/tree-api.ts
+
2
−
17
View file @
3c64bf52
...
...
@@ -8,21 +8,6 @@ function getTreeApiUrl() {
);
}
function
preparePath
(
path
:
string
){
let
resultString
=
''
;
if
(
path
.
charAt
(
0
)
===
'
/
'
)
{
path
=
path
.
substring
(
1
);
}
let
array
=
path
.
split
(
'
/
'
);
for
(
let
i
=
0
;
i
<
array
.
length
;
i
++
)
{
resultString
+=
encodeURIComponent
(
array
[
i
]);
if
(
i
!==
array
.
length
-
1
)
{
resultString
+=
'
/
'
;
}
}
return
resultString
;
}
export
class
TreeApi
{
public
static
getMetadata
(
resourceId
:
string
,
...
...
@@ -32,7 +17,7 @@ export class TreeApi {
)
{
apiConnectionBasic
.
setHeader
();
return
axios
.
get
(
getTreeApiUrl
()
+
resourceId
+
'
/
'
+
preparePath
(
path
))
.
get
(
getTreeApiUrl
()
+
resourceId
+
'
/
'
+
apiConnectionBasic
.
preparePath
(
path
))
.
then
(
thenHandler
)
.
catch
(
catchHandler
);
}
...
...
@@ -60,7 +45,7 @@ export class TreeApi {
}
return
axios
.
put
(
getTreeApiUrl
()
+
resourceId
+
'
/
'
+
preparePath
(
path
),
body
)
.
put
(
getTreeApiUrl
()
+
resourceId
+
'
/
'
+
apiConnectionBasic
.
preparePath
(
path
),
body
)
.
then
(
thenHandler
)
.
catch
(
catchHandler
);
}
...
...
...
...
This diff is collapsed.
Click to expand it.
CoscineBot
@CoscineBot
mentioned in commit
58426be6
·
Aug 25, 2020
mentioned in commit
58426be6
mentioned in commit 58426be6d8b253645184c9cc7d0862c334898a67
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment