summaryrefslogtreecommitdiff
path: root/php-src/PSR7Client.php
diff options
context:
space:
mode:
Diffstat (limited to 'php-src/PSR7Client.php')
-rw-r--r--php-src/PSR7Client.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/php-src/PSR7Client.php b/php-src/PSR7Client.php
index f8913a8d..d1d8ee8c 100644
--- a/php-src/PSR7Client.php
+++ b/php-src/PSR7Client.php
@@ -9,6 +9,7 @@ namespace Spiral\RoadRunner;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
+use Spiral\RoadRunner\Worker;
use Zend\Diactoros;
/**
@@ -64,7 +65,7 @@ class PSR7Client
$bodyStream->write($body);
}
- return new Diactoros\ServerRequest(
+ $request = new Diactoros\ServerRequest(
$_SERVER,
$this->wrapUploads($ctx['uploads']),
$ctx['uri'],
@@ -76,6 +77,14 @@ class PSR7Client
$parsedBody,
$ctx['protocol']
);
+
+ if (!empty($ctx['attributes'])) {
+ foreach ($ctx['attributes'] as $key => $value) {
+ $request = $request->withAttribute($key, $value);
+ }
+ }
+
+ return $request;
}
/**