Uploading a binary fails if you use a custom domain (BB-7046)

Issue #5857 duplicate
Jeshan Babooa
created an issue

See attached.

It's supposed to upload a binary of size 9.03 MiB (I believe there are no size limits on BitBucket) and then redirect to custom domain, but it fails with the shown error.