mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
Preventing uploads from other origin
This commit is contained in:
parent
ea1e22613e
commit
8a60b257a2
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,13 @@
|
|||
|
||||
//session_start();
|
||||
|
||||
$hostname = exec('hostname');
|
||||
$port = $_SERVER['SERVER_PORT'];
|
||||
$expected_http_origin="https://".$hostname.":".$port;
|
||||
if ($_SERVER['HTTP_ORIGIN'] != $expected_http_origin) {
|
||||
die ("Nope.");
|
||||
}
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
// Check login_as feature
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue