Skip to content

Commit a36642e

Browse files
committed
refactory
1 parent 8752592 commit a36642e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Server.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ public function execute(ServerRequestInterface $request = null)
130130

131131
// Check if message is signed and if so verify it
132132
if ($payload->isSigned()) {
133+
134+
if (! $micalg) {
135+
$micalg = $payload->getParsedHeader('content-type', 0, 'micalg');
136+
}
137+
133138
$this->getLogger()->debug('Inbound AS2 message is signed.');
134139
$this->getLogger()->debug(
135140
sprintf('The sender used the algorithm "%s" to sign the inbound AS2 message.', $micalg)
@@ -144,9 +149,6 @@ public function execute(ServerRequestInterface $request = null)
144149
$this->getLogger()->debug(sprintf('Found %s payload attachments in the inbound AS2 message.',
145150
$payload->getCountParts() - 1));
146151

147-
if (! $micalg) {
148-
$micalg = $payload->getParsedHeader('content-type', 0, 'micalg');
149-
}
150152
foreach ($payload->getParts() as $part) {
151153
if (! $part->isPkc7Signature()) {
152154
$payload = $part;

0 commit comments

Comments
 (0)