Thanks for the updates! Please change this line to avoid iterating over a plain array with `$.fn.each()`. Use `$.each()` instead:
`$.each( xhrCorsHeaders, function( i, headerName ) {`