Fixes #3657: Wrong attachment URL when using relative base URL