lostisland/faraday — pull request #376 by ketan (2014-05-05 15:05:54+00:00)
Title: Faraday::Utils::Headers#replace has side-effects

The headers hash contains some local state inside the @names instance variable as a means of doing case-insensitive hashes. This has the side-effect that one has to remember to perform mirror operations on the @names hash in addition to the object itself(Headers).

A case in point is the replace method – which did not clear out the @names hash which was causing side-effects by not performing a mirror operation (clear) on the @names hash.