Change ip and user_agent request

Fix for KeyError: 'HTTP_USER_AGENT'