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
6 changes: 3 additions & 3 deletions src/MGRAST/cgi/api.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if (lc($request_method) eq 'options') {
-type => 'text/plain',
-charset => 'UTF-8',
-Access_Control_Allow_Methods => 'POST, GET, OPTIONS',
-Access_Control_Allow_Headers => 'AUTH'
-Access_Control_Allow_Headers => 'AUTH, AUTHORIZATION'
);
print "";
exit 0;
Expand Down Expand Up @@ -150,12 +150,12 @@ else {

# check for authentication
my $user;
if ($cgi->http('HTTP_AUTH') || $cgi->param('auth')) {
if ($cgi->http('HTTP_AUTH') || $cgi->param('auth') || $cgi->http('HTTP_AUTHORIZATION') || $cgi->param('authorization')) {
eval {
require Auth;
Auth->import();
my $message;
($user, $message) = Auth::authenticate($cgi->http('HTTP_AUTH') || $cgi->param('auth'));
($user, $message) = Auth::authenticate($cgi->http('HTTP_AUTH') || $cgi->param('auth') || $cgi->http('HTTP_AUTHORIZATION') || $cgi->param('authorization'));
unless($user) {
unless ($message eq "valid kbase user") {
print $cgi->header( -type => 'application/json',
Expand Down
14 changes: 13 additions & 1 deletion src/MGRAST/lib/JobDB/Job.pm
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,19 @@ sub fetch_browsepage_in_progress {
};
if ($@ || (! $stats) || (exists($stats->{error}) && $stats->{error})) {
print STDERR "AWE job info retrieval failed for user ".$user->{_id}.": $@".($stats && $stats->{error} ? $stats->{error} : "")."\n";
return $count_only ? 0 : [];
if ($count_only) {
return scalar(@$jobs);
} else {
my $data_table = [];
foreach my $job (@$jobs) {
push(@$data_table, { job_id => $job->{job_id},
metagenome_id => $job->{metagenome_id},
metagenome_name => $job->{metagenome_name},
states => [],
status => $job->{current_stage} });
}
return $data_table;
}
} else {
my $stati = $stats->{data};
if ($count_only) {
Expand Down
2 changes: 1 addition & 1 deletion src/WebApplication/WebComponent/Register.pm
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ sub country_codes {
'AG' => 'Antigua and Barbuda',
'GT' => 'Guatemala',
'MC' => 'Monaco',
'GE' => 'Abkhazia',
'GE' => 'Georgia',
'CY' => 'Northern Cyprus',
'LV' => 'Latvia',
'MH' => 'Marshall Islands',
Expand Down