addFromURL() Not Following Redirects


I’m running this in NodeJS:

const ipfs = require('ipfs');
const node = new ipfs();
node.addFromURL("", (error, result) => {
  if (error) {
  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 is doing some User Agent sniffing to determine when to serve 200 OK html and when to serve 302 Redirect. ¯\ (ツ) /¯