mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge branch 'master' of github.com:appwrite/appwrite into restify
This commit is contained in:
@@ -7,16 +7,13 @@
|
||||
<br />
|
||||
</p>
|
||||
|
||||
[](https://hub.docker.com/r/appwrite/appwrite)
|
||||
[](https://discord.gg/GSeTUeA)
|
||||
[](https://travis-ci.org/appwrite/appwrite)
|
||||
[](https://github.com/appwrite/appwrite/stargazers)
|
||||
[](https://stackshare.io/appwrite)
|
||||
[](https://app.releasly.co/sites/appwrite/appwrite?utm_source=github_badge)
|
||||
[](https://opensource.org/licenses/BSD-3-Clause)
|
||||
[](https://twitter.com/appwrite_io)
|
||||
|
||||
---
|
||||
[](https://discord.gg/GSeTUeA)
|
||||
[](https://travis-ci.org/appwrite/appwrite)
|
||||
[](https://travis-ci.org/appwrite/appwrite)
|
||||
[](https://twitter.com/appwrite_io)
|
||||
[](https://stackshare.io/appwrite)
|
||||
|
||||
|
||||
Appwrite is a simple self-hosted backend server for web and mobile developers with a shiny dashboard and a very easy-to-use REST API.
|
||||
|
||||
|
||||
+2
-1
@@ -83,11 +83,12 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $
|
||||
/*
|
||||
* Validate Client Domain - Check to avoid CSRF attack
|
||||
* Adding Appwrite API domains to allow XDOMAIN communication
|
||||
* Skip this check for non-web platforms which are not requiredto send an origin header
|
||||
*/
|
||||
$hostValidator = new Host($clients);
|
||||
$origin = $request->getServer('HTTP_ORIGIN', $request->getServer('HTTP_REFERER', ''));
|
||||
|
||||
if (!$hostValidator->isValid($origin)
|
||||
if (!empty($origin) && !$hostValidator->isValid($origin)
|
||||
&& in_array($request->getMethod(), [Request::METHOD_POST, Request::METHOD_PUT, Request::METHOD_PATCH, Request::METHOD_DELETE])
|
||||
&& empty($request->getHeader('X-Appwrite-Key', ''))) {
|
||||
throw new Exception('Access from this client host is forbidden. '.$hostValidator->getDescription(), 403);
|
||||
|
||||
Reference in New Issue
Block a user