Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MGRAST/lib/resources/download.pm
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ sub instance {
foreach my $set (@$setlist) {
if (($set->{file_id} eq $file) || ($set->{file_name} eq $file)) {
if ($link) {
my $data = $self->get_shock_preauth($set->{node_id}, $self->mgrast_token);
my $data = $self->get_shock_preauth($set->{node_id}, $self->mgrast_token, $set->{file_name});
$self->return_data($data);
} else {
$self->return_shock_file($set->{node_id}, $set->{file_size}, $set->{file_name}, $self->mgrast_token);
Expand Down
4 changes: 2 additions & 2 deletions src/MGRAST/lib/resources/job.pm
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ sub info {
'required' => {},
'body' => { "metagenome_id" => ["string", "unique MG-RAST metagenome identifier"],
"user_id" => ["string", "unique user identifier to share with"],
"user_email" => ["string", "user email to share with"].
"user_email" => ["string", "user email to share with"],
"edit" => ["boolean", "if true edit rights shared, else (default) view rights only"] } }
},
{ 'name' => "public",
Expand Down Expand Up @@ -453,4 +453,4 @@ sub get_post_data {
return $pdata;
}

1;
1;
4 changes: 2 additions & 2 deletions src/MGRAST/lib/resources/resource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -760,12 +760,12 @@ sub get_shock_node {

# get the shock preauth url for a file
sub get_shock_preauth {
my ($self, $id, $auth) = @_;
my ($self, $id, $auth, $fn) = @_;

my $response = undef;
eval {
my @args = $auth ? ('Authorization', "OAuth $auth") : ();
my $get = $self->agent->get($Conf::shock_url.'/node/'.$id.'?download_url', @args);
my $get = $self->agent->get($Conf::shock_url.'/node/'.$id.'?download_url'.($fn ? "&filename=".$fn : ""), @args);
$response = $self->json->decode( $get->content );
};
if ($@ || (! ref($response))) {
Expand Down