Dispatch hooks before following redirects

Fixes #1183
Merge pull request #1185 from sigmavirus24/fix_hook_dispatching

Dispatch hooks before following redirects
Update resolve_redirects to check for 307 & 308