Bugfix: add 307 retry logic