summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-01-17 12:58:51 +0300
committerWolfy-J <[email protected]>2019-01-17 12:58:51 +0300
commit7a13e71af6a81039e119cc7b9e7592f93de59e60 (patch)
tree6ba3f88dd7c7f5c70c634ee3561da8a8b6eb1b39
parentd92d3a253d4dec4ca37523b89ad932a471db02b8 (diff)
__SERVER now support HTTP_... values
-rw-r--r--src/PSR7Client.php2
-rw-r--r--tests/http/server.php11
2 files changed, 11 insertions, 2 deletions
diff --git a/src/PSR7Client.php b/src/PSR7Client.php
index 350637e2..6b280272 100644
--- a/src/PSR7Client.php
+++ b/src/PSR7Client.php
@@ -132,8 +132,6 @@ class PSR7Client
$response->getBody()->__toString(),
json_encode(['status' => $response->getStatusCode(), 'headers' => $headers])
);
-
- $_SERVER = $this->originalServer;
}
/**
diff --git a/tests/http/server.php b/tests/http/server.php
new file mode 100644
index 00000000..e5b295b6
--- /dev/null
+++ b/tests/http/server.php
@@ -0,0 +1,11 @@
+<?php
+
+use Psr\Http\Message\ResponseInterface;
+use Psr\Http\Message\ServerRequestInterface;
+
+function handleRequest(ServerRequestInterface $req, ResponseInterface $resp): ResponseInterface
+{
+ $resp->getBody()->write(strtoupper($req->getHeaderLine('input')));
+
+ return $resp->withAddedHeader("Header", $req->getQueryParams()['hello']);
+} \ No newline at end of file