addFromURL() Not Following Redirects

Hello!

I’m running this in NodeJS:

const ipfs = require('ipfs');
const node = new ipfs();
node.addFromURL("http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1810.iso", (error, result) => {
  if (error) {
    console.log(error.message);
  }
  console.log("Added " + result[0].path + " to IPFS - " + result[0].hash);
});

I get the hash almost right away, but it looks like js-ipfs is adding that HTML page to IPFS, not the ISO. I’m confused by this, because I thought that js-ipfs was supposed to follow redirects. If I wget that same URL, it 302 Redirects to a mirror. Help?

As discussed in Issue #2314, it looks like isoredirect.centos.org is doing some User Agent sniffing to determine when to serve 200 OK html and when to serve 302 Redirect. ¯\ (ツ) /¯