get origin for request symfony

Solutions on MaxInterview for get origin for request symfony by the best coders in the world

showing results for - "get origin for request symfony"
Juan José
09 Mar 2017
1if (array_key_exists('HTTP_ORIGIN', $_SERVER)) {
2    $origin = $_SERVER['HTTP_ORIGIN'];
3}
4else if (array_key_exists('HTTP_REFERER', $_SERVER)) {
5    $origin = $_SERVER['HTTP_REFERER'];
6} else {
7    $origin = $_SERVER['REMOTE_ADDR'];
8}