Change getMimeType and setMimeType to response->content_type.
This commit is contained in:
parent
e5adc07a05
commit
fd8f03a186
52 changed files with 138 additions and 175 deletions
|
|
@ -64,7 +64,7 @@ sub handler {
|
|||
else {
|
||||
$session->log->warn("User ".$session->user->username." tried to execute ajaxGetI18n but could not decode JSON string: $json");
|
||||
}
|
||||
$session->http->setMimeType( "application/json" );
|
||||
$session->response->content_type( "application/json" );
|
||||
return JSON->new->encode( $response );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -134,10 +134,10 @@ sub handler {
|
|||
assets => \@assets
|
||||
};
|
||||
if ($as eq "xml") {
|
||||
$session->http->setMimeType('text/xml');
|
||||
$session->response->content_type('text/xml');
|
||||
return XML::Simple::XMLout($document, NoAttr => 1);
|
||||
}
|
||||
$session->http->setMimeType('application/json');
|
||||
$session->response->content_type('application/json');
|
||||
return JSON->new->encode($document);
|
||||
}
|
||||
return undef;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ EOSQL
|
|||
$results{'startIndex'} = $startIndex;
|
||||
$results{'sort'} = undef;
|
||||
$results{'dir'} = $sortDir;
|
||||
$session->http->setMimeType('application/json');
|
||||
$session->response->content_type('application/json');
|
||||
my $json = JSON::to_json(\%results);
|
||||
return $json;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ sub www_ajaxGetManagerPage {
|
|||
$assetInfo->{ sort } = $session->form->get( 'orderByColumn' );
|
||||
$assetInfo->{ dir } = lc $session->form->get( 'orderByDirection' );
|
||||
|
||||
$session->http->setMimeType( 'application/json' );
|
||||
$session->response->content_type( 'application/json' );
|
||||
|
||||
return to_json( $assetInfo );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ sub handler {
|
|||
.'</urlset>';
|
||||
|
||||
|
||||
$session->http->setMimeType('text/xml');
|
||||
$session->response->content_type('text/xml');
|
||||
|
||||
return $xml;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue