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
|
|
@ -84,7 +84,7 @@ sub www_auth {
|
|||
my $method = $authMethod->can( 'www_' . $methodCall )
|
||||
|| $authMethod->can( $methodCall );
|
||||
my $out = $method->( $authMethod );
|
||||
if (substr($session->http->getMimeType(),0,9) eq "text/html") {
|
||||
if (substr($session->response->content_type(),0,9) eq "text/html") {
|
||||
return $session->style->userStyle($out);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ Checks to ensure the requestor is who we think it is, and then executes a cron j
|
|||
|
||||
sub www_runCronJob {
|
||||
my $session = shift;
|
||||
$session->http->setMimeType("text/plain");
|
||||
$session->response->content_type("text/plain");
|
||||
$session->http->setCacheControl("none");
|
||||
unless (Net::CIDR::Lite->new(@{ $session->config->get('spectreSubnets') })->find($session->request->address) || canView($session)) {
|
||||
$session->log->security("make a Spectre cron job runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")}).".");
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ Checks to ensure the requestor is who we think it is, and then returns a JSON st
|
|||
|
||||
sub www_spectreGetSiteData {
|
||||
my $session = shift;
|
||||
$session->http->setMimeType("application/json");
|
||||
$session->response->content_type("application/json");
|
||||
$session->http->setCacheControl("none");
|
||||
my %siteData = ();
|
||||
my $subnets = $session->config->get("spectreSubnets");
|
||||
|
|
@ -173,7 +173,7 @@ spectreSubnet, instead of checking the IP address of the spectre process.
|
|||
|
||||
sub www_spectreTest {
|
||||
my $session = shift;
|
||||
$session->http->setMimeType("text/plain");
|
||||
$session->response->content_type("text/plain");
|
||||
$session->http->setCacheControl("none");
|
||||
|
||||
my $subnets = $session->config->get("spectreSubnets");
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ sub www_spellCheck {
|
|||
}
|
||||
# add request id and send to client as JSON blob
|
||||
$result->{id} = $params->{id};
|
||||
$session->http->setMimeType("text/plain; charset=utf-8");
|
||||
$session->response->content_type("text/plain; charset=utf-8");
|
||||
return JSON->new->encode($result);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ sub www_ajaxCreateUser {
|
|||
$mimeType = "application/xml";
|
||||
}
|
||||
|
||||
$session->http->setMimeType( $mimeType );
|
||||
$session->response->content_type( $mimeType );
|
||||
|
||||
# Verify access
|
||||
if ( !canAdd($session) || !canUseService($session) ) {
|
||||
|
|
@ -436,7 +436,7 @@ sub www_ajaxDeleteUser {
|
|||
$mimeType = "application/xml";
|
||||
}
|
||||
|
||||
$session->http->setMimeType( $mimeType );
|
||||
$session->response->content_type( $mimeType );
|
||||
|
||||
# Verify access
|
||||
if ( !canEdit($session) || !canUseService($session) ) {
|
||||
|
|
@ -503,7 +503,7 @@ sub www_ajaxUpdateUser {
|
|||
$mimeType = "application/xml";
|
||||
}
|
||||
|
||||
$session->http->setMimeType( $mimeType );
|
||||
$session->response->content_type( $mimeType );
|
||||
|
||||
# Verify access
|
||||
if ( !canEdit($session) || !canUseService($session) ) {
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ Checks to ensure the requestor is who we think it is, and then executes a workfl
|
|||
|
||||
sub www_runWorkflow {
|
||||
my $session = shift;
|
||||
$session->http->setMimeType("text/plain");
|
||||
$session->response->content_type("text/plain");
|
||||
$session->http->setCacheControl("none");
|
||||
unless (Net::CIDR::Lite->new(@{ $session->config->get('spectreSubnets')} )->find($session->request->address) || canRunWorkflow($session)) {
|
||||
$session->log->security("make a Spectre workflow runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")}).".");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue