Make the HTTP proxy code more resilient to different HTTP responses