'Returns either the Origin or Referer value from the request headers.'

def origin_from_request(self, request):

    if (request.META.get('HTTP_ORIGIN') == 'null'):
        return 'null'
    return origin_from_request(request)
