Commit edaf9dd0 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[Downloader::Request] Use a hex digest of downloader options

This way, we never exceed file length limits
parent fde74d05
require 'digest'
module Pod
module Downloader
# This class represents a download request for a given Pod.
......@@ -65,8 +67,9 @@ module Pod
if released_pod?
"Release/#{name}/#{spec.version}#{checksum}"
else
opts = params.to_a.sort_by(&:first).map { |k, v| "#{k}=#{v}" }.join('-').gsub(/(#{Regexp.escape File::SEPARATOR})+/, '+')
"External/#{name}/#{opts}#{checksum}"
opts = params.to_a.sort_by(&:first).map { |k, v| "#{k}=#{v}" }.join('-')
digest = Digest::MD5.hexdigest(opts)
"External/#{name}/#{digest}#{checksum}"
end
end
......
......@@ -74,7 +74,7 @@ module Pod
end
it 'returns the slug' do
@request.slug.should == 'External/BananaLib/git=http:+banana-corp.local+banana-lib.git-tag=v1.0'
@request.slug.should == 'External/BananaLib/a0856313adccfbcc7c5b0ea859ee14f5'
end
end
end
......
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