Fix CustomEvent polyfill
Use upper case when testing for HTTP request type