Replace hacky fix for HTTP issue with more permanent solution