Commit 0dc514c2 authored by Stan Hu's avatar Stan Hu

Merge branch 'remove-redirects-import_export_command_line_util' into 'master'

Support 303 redirects when downloading via CommandLineUtil

See merge request gitlab-org/gitlab!83066
parents 2948fd16 240bf638
......@@ -66,7 +66,7 @@ module Gitlab
current_size = 0
Gitlab::HTTP.get(url, stream_body: true, allow_object_storage: true) do |fragment|
if [301, 302, 307].include?(fragment.code)
if [301, 302, 303, 307].include?(fragment.code)
Gitlab::Import::Logger.warn(message: "received redirect fragment", fragment_code: fragment.code)
elsif fragment.code == 200
current_size += fragment.bytesize
......
......@@ -114,7 +114,7 @@ RSpec.describe Gitlab::ImportExport::CommandLineUtil do
end
end
%w[MOVED_PERMANENTLY FOUND TEMPORARY_REDIRECT].each do |code|
%w[MOVED_PERMANENTLY FOUND SEE_OTHER TEMPORARY_REDIRECT].each do |code|
context "with a redirect status code #{code}" do
let(:status) { HTTP::Status.const_get(code, false) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment