lib/protocol/http/headers.rb in protocol-http-0.4.0 vs lib/protocol/http/headers.rb in protocol-http-0.4.1
- old
+ new
@@ -179,9 +179,13 @@
def delete(key)
deleted, @fields = @fields.partition do |field|
field.first.downcase == key
end
+ if deleted.empty?
+ return nil
+ end
+
if @indexed
return @indexed.delete(key)
elsif policy = MERGE_POLICY[key]
(key, value), *tail = deleted
merged = policy.new(value)