WP-1277: Improve HTTP handler's robustness