Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Commit

Permalink
remove pnp specific stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Webonaute committed Sep 25, 2020
1 parent ae95381 commit 93a51b5
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/Server/HttpFoundation/GrpcResponseProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,8 @@ public function process(HttpFoundationResponse $httpFoundationResponse, SwooleRe
$content = pack('CN', 0, strlen($content)).$content;
$httpFoundationResponse->setContent($content);

if ($httpFoundationResponse->headers->has('Grpc-Message')) {
$value = $httpFoundationResponse->headers->get('Grpc-Message', '');
$httpFoundationResponse->headers->remove('Grpc-Message');
$httpFoundationResponse->headers->set('Pnp-Grpc-Message', $value);
}

if ($httpFoundationResponse->headers->has('Grpc-Status-Details-Bin')) {
$value = $httpFoundationResponse->headers->get('Grpc-Status-Details-Bin', '');
$httpFoundationResponse->headers->remove('Grpc-Status-Details-Bin');
$httpFoundationResponse->headers->set('Pnp-Grpc-Status-Details-Bin', $value);
}

if ($httpFoundationResponse->headers->has('Grpc-Status')) {
$value = $httpFoundationResponse->headers->get('Grpc-Status', '');
$httpFoundationResponse->headers->remove('Grpc-Status');
$httpFoundationResponse->headers->set('Pnp-Grpc-Status', $value);
} else {
$httpFoundationResponse->headers->set('Pnp-Grpc-Status', '0');
if (!$httpFoundationResponse->headers->has('Grpc-Status')) {
$httpFoundationResponse->headers->set('Grpc-Status', '0');
}
}

Expand Down

0 comments on commit 93a51b5

Please sign in to comment.