HTTP_ORIGIN wasn't working on Firefox, changed it to get_host() instead