Fix the logic for the request method detection