1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

Fix proxy internal http communication

This commit is contained in:
Matej Bačo 2023-06-07 10:52:16 +02:00
parent 04f3d81ab8
commit 6c81b3e3f8

View file

@ -292,7 +292,7 @@ App::init()
* @see https://www.owasp.org/index.php/List_of_useful_HTTP_headers
*/
if (App::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS
if ($request->getProtocol() !== 'https') {
if ($request->getProtocol() !== 'https' && $origin !== 'localhost') { // Localhost allowed for proxy
if ($request->getMethod() !== Request::METHOD_GET) {
throw new AppwriteException(AppwriteException::GENERAL_PROTOCOL_UNSUPPORTED, 'Method unsupported over HTTP.');
}