Skip to content

Commit

Permalink
Merge branch 'rel-10_1' into issue-#1431-middleware_secure_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Nov 22, 2021
2 parents b10a574 + 5c662be commit c3d32a3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Kernel/GenericInterface/Requester.pm
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ sub Run {
# Extend the data include payload/
$DataInclude{RequesterRequestPrepareOutput} = $FunctionResult->{Data};

my %CustomHeader;
if ( $FunctionResult->{Header} ) {
%CustomHeader = (
CustomHeader => $FunctionResult->{Header},
);
}

#
# Map the outgoing data.
#
Expand Down Expand Up @@ -317,6 +324,7 @@ sub Run {
$FunctionResult = $TransportObject->RequesterPerformRequest(
Operation => $Param{Invoker},
Data => $DataOut,
%CustomHeader,
);

my $IsAsynchronousCall = $Param{Asynchronous} ? 1 : 0;
Expand Down
12 changes: 12 additions & 0 deletions Kernel/GenericInterface/Transport/HTTP/REST.pm
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,18 @@ sub RequesterPerformRequest {
);
}

if ( $Param{CustomHeader} ) {
$Headers = {
%{$Headers},
%{ $Param{CustomHeader} },
};

$Self->{DebuggerObject}->Debug(
Summary => "Custom headers used (might overwrite authorization)",
Data => join( '; ', keys %{ $Param{CustomHeader} } ),
);
}

my $RestCommand = $Config->{DefaultCommand};
if ( IsStringWithData( $Config->{InvokerControllerMapping}->{ $Param{Operation} }->{Command} ) )
{
Expand Down

0 comments on commit c3d32a3

Please sign in to comment.