Fix artifacts upload redirection support
What does this MR do?
Fixes the redirection handler added in !3303 (merged).
Why was this MR needed?
Follow-up for !3303 (merged). Part of https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/14874.
While the fix in the previous MR added expected handling of 307 Temporary Redirect
response, it messed up the configuration of new URL that artifacts uploader will use on a retry. It ended with the /jobs/:d/
part being added twice in the final URL which obviously ends with 404 Not Found
response from GitLab.
As the integration was not asserting the Request Path nor method and just only the content of the request it didn't show a problem.
This MR updates the integration test to also check that the method and Request Path are what the artifacts API expects. And it updates the way how location
value is changed into job credetntials' URL
, so that a proper URL is created for the retried request.