Fix Accept header overwritten issue when "xhr: true" in integration test
#26003

darkbaby123 wants to merge darkbaby123:fix_xhr_overwrite_headers_in_test into rails:master

We do not currently have an analysis of these two commits