Skip to content

Commit c215c4b

Browse files
committed
Servery 0.2.2
1 parent bbc36c9 commit c215c4b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Includes the following helpers:
1515
- [Matcher](https://github.com/nabeghe/matcher-php)<small> v1.0.0</small>
1616
- [Mem](https://github.com/nabeghe/mem-php) <small>v1.2.0</small>
1717
- [Reflecty](https://github.com/nabeghe/reflecty-php) <small>v0.5.0</small>
18-
- [Servery](https://github.com/nabeghe/servery-php) <small>v0.2.1</small>
18+
- [Servery](https://github.com/nabeghe/servery-php) <small>v0.2.2</small>
1919
- [Shortnum](https://github.com/nabeghe/shortnum-php) <small>v1.0.0</small>
2020
- [SimpleCipher](https://github.com/nabeghe/simple-cipher-php) <small>v1.0.0</small>
2121
- [Stringer](https://github.com/nabeghe/stringer-php) <small>v1.1.3</small>

src/Servery/Servery.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ public static function getDomain(): string
209209
*/
210210
public static function isHttps(): bool
211211
{
212-
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443);
212+
return (
213+
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ||
214+
($_SERVER['SERVER_PORT'] ?? null) == 443 ||
215+
($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? null) === 'https'
216+
);
213217
}
214218

215219
/**

0 commit comments

Comments
 (0)