Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1309b64

Browse filesBrowse files
bug #77 fix conversion for https requests (4rthem)
This PR was merged into the 2.0-dev branch. Discussion ---------- fix conversion for https requests HTTPS requests were not correctly converted. Commits ------- d336c73 fix conversion for https requests
2 parents e86de3f + d336c73 commit 1309b64
Copy full SHA for 1309b64

File tree

2 files changed

+16
-5
lines changed
Filter options

2 files changed

+16
-5
lines changed

‎Factory/HttpFoundationFactory.php

Copy file name to clipboardExpand all lines: Factory/HttpFoundationFactory.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public function createRequest(ServerRequestInterface $psrRequest, bool $streamed
5252
$server['SERVER_PORT'] = $uri->getPort();
5353
$server['REQUEST_URI'] = $uri->getPath();
5454
$server['QUERY_STRING'] = $uri->getQuery();
55+
56+
if ('https' === $uri->getScheme()) {
57+
$server['HTTPS'] = 'on';
58+
}
5559
}
5660

5761
$server['REQUEST_METHOD'] = $psrRequest->getMethod();

‎Tests/Functional/CovertTest.php

Copy file name to clipboardExpand all lines: Tests/Functional/CovertTest.php
+12-5Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,24 @@ public function requestProvider()
139139
'Content'
140140
);
141141

142-
$psr7Request = (new Psr7Request('POST', 'http://tnyholm.se/foo/?bar=biz'))
143-
->withQueryParams(['bar' => 'biz']);
142+
$psr7Requests = [
143+
(new Psr7Request('POST', 'http://tnyholm.se/foo/?bar=biz'))
144+
->withQueryParams(['bar' => 'biz']),
145+
new Psr7Request('GET', 'https://hey-octave.com/'),
146+
new Psr7Request('GET', 'https://hey-octave.com:443/'),
147+
new Psr7Request('GET', 'https://hey-octave.com:4242/'),
148+
new Psr7Request('GET', 'http://hey-octave.com:80/'),
149+
];
144150

145151
$nyholmFactory = new Psr17Factory();
146152
$psr17Factory = new PsrHttpFactory($nyholmFactory, $nyholmFactory, $nyholmFactory, $nyholmFactory);
147153
$symfonyFactory = new HttpFoundationFactory();
148154

149-
return [
155+
return array_merge([
150156
[$sfRequest, $psr17Factory, $symfonyFactory],
151-
[$psr7Request, $symfonyFactory, $psr17Factory],
152-
];
157+
], array_map(function ($psr7Request) use ($symfonyFactory, $psr17Factory) {
158+
return [$psr7Request, $symfonyFactory, $psr17Factory];
159+
}, $psr7Requests));
153160
}
154161

155162
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.