fix: add check for localhost domain
This commit is contained in:
parent
11f2ee8a1c
commit
90eed32311
1 changed files with 1 additions and 1 deletions
|
@ -378,7 +378,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' && ($swooleRequest->header['host'] ?? '') !== APP_HOSTNAME_INTERNAL) { // APP_HOSTNAME_INTERNAL allowed for migrations
|
if ($request->getProtocol() !== 'https' && ($swooleRequest->header['host'] ?? '') !== 'localhost' && ($swooleRequest->header['host'] ?? '') !== APP_HOSTNAME_INTERNAL) { // localhost allowed for proxy, APP_HOSTNAME_INTERNAL allowed for migrations
|
||||||
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