hmm not sure why this differs from http://mxr.mozilla.org/mozilla-central/source/netwerk/base/src/NetUtil.jsm#299 can we just use [`NetUtils.jsm`](https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/NetUtil.jsm) here?