diff --git a/lib/vanagon/component/source/http.rb b/lib/vanagon/component/source/http.rb index 05097b1d..5b2fddd0 100644 --- a/lib/vanagon/component/source/http.rb +++ b/lib/vanagon/component/source/http.rb @@ -82,6 +82,13 @@ def initialize(url, sum:, workdir:, sum_type:, **options) # Download the source from the url specified. Sets the full path to the # file as @file and the @extension for the file as a side effect. def fetch + @file = File.basename(URI.parse(@url).path) + begin + return if verify + rescue RuntimeError, Errno::ENOENT + remove_instance_variable(:@file) + end + @file = download(@url) end