module Protocol::HTTP::URL

def self.decode(string, maximum = 8, symbolize_keys: false)

def self.decode(string, maximum = 8, symbolize_keys: false)
	parameters = {}
	
	self.scan(string) do |name, value|
		keys = self.split(name)
		
		if keys.count > maximum
			raise ArgumentError, "Key length exceeded limit!"
		end
		
		if symbolize_keys
			keys.collect!{|key| key.empty? ? nil : key.to_sym}
		end
		
		self.assign(keys, value, parameters)
	end
	
	return parameters
end