10000 Fixed getScheme() method · laravel/lumen-framework@d374a8b · GitHub
[go: up one dir, main page]

Skip to content

Commit d374a8b

Browse files
committed
Fixed getScheme() method
Added property forceSchema to class, replaced $this->request with $this->app->make('request') in getScheme()
1 parent e448d32 commit d374a8b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Routing/UrlGenerator.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ class UrlGenerator
2626
* @var string|null
2727
*/
2828
protected $cachedRoot;
29+
30+
/**
31+
* Url schema to be forced
32+
*
33+
* @var string|null
34+
*/
35+
protected $forceSchema;
2936

3037
/**
3138
* Create a new URL redirector instance.
@@ -156,7 +163,7 @@ protected function getScheme($secure)
156163
{
157164
if (is_null($secure))
158165
{
159-
return $this->forceSchema ?: $this->request->getScheme().'://';
166+
return $this->forceSchema ?: $this->app->make('request')->getScheme().'://';
160167
}
161168

162169
return $secure ? 'https://' : 'http://';

0 commit comments

Comments
 (0)
0