Fix localhost https
This commit is contained in:
parent
6c81b3e3f8
commit
2e11d85033
1 changed files with 1 additions and 1 deletions
|
@ -292,7 +292,7 @@ App::init()
|
||||||
* @see https://www.owasp.org/index.php/List_of_useful_HTTP_headers
|
* @see https://www.owasp.org/index.php/List_of_useful_HTTP_headers
|
||||||
*/
|
*/
|
||||||
if (App::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS
|
if (App::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS
|
||||||
if ($request->getProtocol() !== 'https' && $origin !== 'localhost') { // Localhost allowed for proxy
|
if ($request->getProtocol() !== 'https' && $swooleRequest->header['host'] ?? '' !== 'localhost') { // Localhost allowed for proxy
|
||||||
if ($request->getMethod() !== Request::METHOD_GET) {
|
if ($request->getMethod() !== Request::METHOD_GET) {
|
||||||
throw new AppwriteException(AppwriteException::GENERAL_PROTOCOL_UNSUPPORTED, 'Method unsupported over HTTP.');
|
throw new AppwriteException(AppwriteException::GENERAL_PROTOCOL_UNSUPPORTED, 'Method unsupported over HTTP.');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue