Remote_file resource set maximum number of re-directs to zero


been trying to implement the below wget download command using chef remote_file resource. But I couldn't find a way to avoid the re-directions.

wget -N --max-redirect=0

The --max-redirect=0 flag in wget makes sure that there isn't any redirection.

The download url is sometimes redirected to ISP bill reminder page. And chef remote_file resource downloads this bill reminder html page as a zip file.

I can just add the command to a execute resource by wrapping it within

command "wget -N --max-redirect=0"

But is there any chef native way of setting redirection to zero or false without the use of ruby's open_uri or net ?

My chef recipe is

remote_file "#{node['download-zip-path']}/#{zip}" do
    source "{zip}"
    action :create
    notifies :run, 'execute[unzip_file]', :delayed


Since remote_file resource doesn't handle the redirects, I had make use of a ruby_block that uses Down gem.

ruby_block 'download_openvpn_zip' do
	block do 
		attempt = 2
			retries ||= 0
			tempfile ="{zip},max_redirects: 0) tempfile.path, "#{node['openvpn-conf-path']}/#{tempfile.original_filename}"
			FileUtils.chmod 0644, "#{node['openvpn-conf-path']}/#{tempfile.original_filename}"
		rescue Down::TooManyRedirects => e
			puts "\n \t ERROR: #{e.message}"
			puts "\n \t Unable to download the file from the url "
			puts "\n \t Tried downloading #{retries+1} times"
			retry if (retries += 1) < 1
	action :run
	notifies :run, 'execute[unzip_file]', :delayed