Skip to content

Commit

Permalink
Fixed Perl::Critic errors in Kernel/GenericInterface.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgruner committed Feb 25, 2013
1 parent 8bef0bb commit 36c3732
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
6 changes: 4 additions & 2 deletions Kernel/GenericInterface/Operation/Common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ sub Auth {

# check if a valid SessionID is present
if ($SessionID) {
my $ValidSessionID =
$Self->{SessionObject}->CheckSessionID( SessionID => $SessionID ) if $SessionID;
my $ValidSessionID;
if $SessionID {
$ValidSessionID = $Self->{SessionObject}->CheckSessionID( SessionID => $SessionID );
}
return 0 if !$ValidSessionID;

# get session data
Expand Down
4 changes: 2 additions & 2 deletions Kernel/GenericInterface/Requester.pm
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ sub Run {
Summary => 'MappingOut could not be initialized',
Data => $MappingOutObject,
);
return $Self->DebuggerObject->Error(
return $Self->{DebuggerObject}->Error(
Summary => $FunctionResult->{ErrorMessage},
);
}
Expand All @@ -270,7 +270,7 @@ sub Run {
);

if ( !$FunctionResult->{Success} ) {
return $Self->DebuggerObject->Error(
return $Self->{DebuggerObject}->Error(
Summary => $FunctionResult->{ErrorMessage},
);
}
Expand Down
8 changes: 5 additions & 3 deletions Kernel/GenericInterface/Transport/HTTP/SOAP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ sub ProviderProcessRequest {
}

# convert charset if necessary
my $ContentCharset = $1
if $ENV{'CONTENT_TYPE'} =~ m{ \A .* charset= ["']? ( [^"']+ ) ["']? \z }xmsi;
my $ContentCharset;
if ($ENV{'CONTENT_TYPE'} =~ m{ \A .* charset= ["']? ( [^"']+ ) ["']? \z }xmsi) {
$ContentCharset = $1;
}
if ( $ContentCharset && $ContentCharset !~ m{ \A utf [-]? 8 \z }xmsi ) {
$Content = $Self->{EncodeObject}->Convert2CharsetInternal(
Text => $Content,
Expand Down Expand Up @@ -816,7 +818,7 @@ sub _Output {
# this solution to set the binmode in the constructor and then :utf8 layer before the response
# is sent apparently works in all situations. ( linux circumstances to requires :raw was no
# reproducible, and not tested in this solution).
binmode STDOUT, ':utf8';
binmode STDOUT, ':utf8'; ## no critic

# print data to http - '\r' is required according to HTTP RFCs
my $StatusMessage = HTTP::Status::status_message( $Param{HTTPCode} );
Expand Down
12 changes: 6 additions & 6 deletions Kernel/GenericInterface/Transport/HTTP/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ sub ProviderGenerateResponse {
$Response = HTTP::Response->new( 200 => "OK" );
$Response->protocol('HTTP/1.0');
$Response->content_type("text/plain; charset=UTF-8");
$Response->add_content_utf8( $Request->content );
$Response->add_content_utf8( $Request->content() );
$Response->date(time);
}

Expand Down Expand Up @@ -234,7 +234,7 @@ sub RequesterPerformRequest {
return {
Success => 1,
Data => {
ResponseContent => $Response->content,
ResponseContent => $Response->content(),
},
};
}
Expand Down Expand Up @@ -268,19 +268,19 @@ sub new {
return $Class->SUPER::new(@_);
}

sub request {
sub request { ## no critic
my $Self = shift;

my ( $Request, $Proxy, $Arg, $Size, $Timeout ) = @_;

my $Response = HTTP::Response->new( 200 => "OK" );
$Response->protocol('HTTP/1.0');
$Response->content_type("text/plain; charset=UTF-8");
$Response->add_content_utf8( $Request->content );
$Response->add_content_utf8( $Request->content() );
$Response->date(time);

#print $Request->as_string;
#print $Response->as_string;
#print $Request->as_string();
#print $Response->as_string();

return $Response;
}
Expand Down

0 comments on commit 36c3732

Please sign in to comment.