Merge pull request #7059 from appwrite/fix/function-domains-execution
Fix 400 error on function domain execution
This commit is contained in:
commit
311fc0f0c4
2 changed files with 5 additions and 1 deletions
|
@ -408,7 +408,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' && ($requestHeaders['host'] ?? '') !== 'localhost' && ($requestHeaders['host'] ?? '') !== APP_HOSTNAME_INTERNAL) { // localhost allowed for proxy, 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) {
|
||||
throw new AppwriteException(AppwriteException::GENERAL_PROTOCOL_UNSUPPORTED, 'Method unsupported over HTTP. Please use HTTPS instead.');
|
||||
}
|
||||
|
|
|
@ -107,6 +107,10 @@ class Request extends UtopiaRequest
|
|||
{
|
||||
$headers = $this->generateHeaders();
|
||||
|
||||
if (empty($this->swoole->cookie)) {
|
||||
return $headers;
|
||||
}
|
||||
|
||||
$cookieHeaders = [];
|
||||
foreach ($this->swoole->cookie as $key => $value) {
|
||||
$cookieHeaders[] = "{$key}={$value}";
|
||||
|
|
Loading…
Reference in a new issue