Merge pull request #7144 from spaceapegames/master
Add headers option to URLs in forumlas
This commit is contained in:
commit
c0dca271ef
@ -421,7 +421,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
|||||||
|
|
||||||
args += ["--user", meta.fetch(:user)] if meta.key?(:user)
|
args += ["--user", meta.fetch(:user)] if meta.key?(:user)
|
||||||
|
|
||||||
args += ["--header", meta.fetch(:header)] if meta.key?(:header)
|
args += [meta[:header], meta[:headers]].flatten.compact.flat_map { |h| ["--header", h.strip] }
|
||||||
|
|
||||||
args
|
args
|
||||||
end
|
end
|
||||||
|
@ -241,6 +241,21 @@ describe CurlDownloadStrategy do
|
|||||||
subject.fetch
|
subject.fetch
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "with headers set" do
|
||||||
|
alias_matcher :a_string_matching, :match
|
||||||
|
|
||||||
|
let(:specs) { { headers: ["foo", "bar"] } }
|
||||||
|
|
||||||
|
it "adds the appropriate curl args" do
|
||||||
|
expect(subject).to receive(:system_command!) { |*, args:, **|
|
||||||
|
expect(args.each_cons(2).to_a).to include(["--header", "foo"])
|
||||||
|
expect(args.each_cons(2).to_a).to include(["--header", "bar"])
|
||||||
|
}
|
||||||
|
|
||||||
|
subject.fetch
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#cached_location" do
|
describe "#cached_location" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user