I'm not sure this can be solved so generally.  For example, this would also break redirects, which would be fine.

I can add a follow_redirects flag, default it to True, and do the check only if True.  I think that's the best I can do for now; let me know if you have other ideas.