Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
workflow-service
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tools glue
workflow-service
Commits
0b15349f
Commit
0b15349f
authored
7 years ago
by
Pau Ruiz i Safont
Browse files
Options
Downloads
Patches
Plain Diff
fix: handle correctly downloads at the endpoint
parent
b9582a1e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cwltoolservice/cwl_flask.py
+6
-3
6 additions, 3 deletions
cwltoolservice/cwl_flask.py
with
6 additions
and
3 deletions
cwltoolservice/cwl_flask.py
+
6
−
3
View file @
0b15349f
...
...
@@ -152,7 +152,7 @@ def get_log(jobid):
return
Response
(
job
.
logspooler
())
@APP.route
(
u
'
/jobs/<int:jobid>/output/<
string
:outputid>
'
,
methods
=
[
u
'
GET
'
])
@APP.route
(
u
'
/jobs/<int:jobid>/output/<
path
:outputid>
'
,
methods
=
[
u
'
GET
'
])
@jwt_optional
@job_exists
@user_is_authorized
...
...
@@ -160,7 +160,7 @@ def get_output(jobid, outputid):
job
=
getjob
(
jobid
)
output
=
getoutputobj
(
job
.
status
(),
outputid
)
if
not
output
:
if
not
output
or
not
isfile_or_dir
(
output
)
:
return
abort
(
404
)
(
path
,
filename
)
=
getfile
(
output
)
...
...
@@ -192,10 +192,13 @@ def getoutputobj(status, outputid):
return
ref
except
(
KeyError
,
TypeError
,
ValueError
,
IndexError
)
as
err
:
APP
.
logger
.
warning
(
u
'
Couldn
\'
t
gather
output
"
%s
"
because %s
'
,
outputid
,
str
(
err
))
APP
.
logger
.
info
(
u
'
Couldn
\'
t
retrieve
output
"
%s
"
because %s
'
,
outputid
,
str
(
err
))
return
None
def
isfile_or_dir
(
obj
):
return
isinstance
(
obj
,
dict
)
and
u
'
path
'
in
obj
def
getfile
(
file_dict
):
return
os
.
path
.
split
(
file_dict
[
u
'
path
'
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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
register
or
sign in
to comment