lib/http/protocol/headers.rb in http-protocol-0.9.0 vs lib/http/protocol/headers.rb in http-protocol-0.9.1
- old
+ new
@@ -175,9 +175,11 @@
current_value << value
else
hash[key] = policy.new(value)
end
else
+ raise ArgumentError, "Header #{key} can only be set once!" if hash.include?(key)
+
# We can't merge these, we only expose the last one set.
hash[key] = value
end
end