#!/usr/bin/perl
package RVL::Task::BuildAjaxHeaders;
##LICENSE##
use base qw(RVL::DecorateProcess);
use base qw(RVL::Task::AuthenticateRequest);
use Class::Std::Utils;
{
sub process {
my ($this, $input, $output) = @_;
$this->SUPER::process($input, $output);
RVL::logMessage('', __CONSTANT__::RVL_LOG_DEBUG);
my (@header);
if (${$output}->{responseFormat} eq __CONSTANT__::RVL_RESPONSEFORMAT_HTML) {
@header = (
-type => 'text/html; charset=' . ${$output}->{charset},
-X_Powered_By => 'RV Framework http://www.rvglobalsoft.com',
);
} elsif (${$output}->{responseFormat} eq __CONSTANT__::RVL_RESPONSEFORMAT_XML) {
@header = (
-type => 'text/xml; charset=' . ${$output}->{charset},
-X_Powered_By => 'RV Framework http://www.rvglobalsoft.com',
);
} elsif (${$output}->{responseFormat} eq __CONSTANT__::RVL_RESPONSEFORMAT_PLAIN) {
@header = (
-type => 'text/plain; charset=' . ${$output}->{charset},
-X_Powered_By => 'RV Framework http://www.rvglobalsoft.com',
);
} elsif(${$output}->{responseFormat} eq __CONSTANT__::RVL_RESPONSEFORMAT_JAVASCRIPT) {
@header = (
-type => 'text/javascript; charset=' . ${$output}->{charset},
-X_Powered_By => 'RV Framework http://www.rvglobalsoft.com',
);
} elsif (${$output}->{responseFormat} eq __CONSTANT__::RVL_RESPONSEFORMAT_JSON) {
@header = (
-type => 'application/json; charset=' . ${$output}->{charset},
-X_Powered_By => 'RV Framework http://www.rvglobalsoft.com',
);
}
print RVL::Session::singleton()->header(@header);
}
}
1;
Copyright 2K16 - 2K18 Indonesian Hacker Rulez