local-ch / lhc

🚀 Advanced HTTP Client for Ruby. Fueled with interceptors.
GNU General Public License v3.0
43 stars 1 forks source link

Fix `FrozenError (can't modify frozen String: "[FILTERED]")` #199

Closed ryabrody closed 3 years ago

ryabrody commented 3 years ago

When the main app does a request either with bearer of or basic auth and the LHC config does scrub the whole header config.scrubs[:headers] << 'Authorization' then we run into FrozenError (can't modify frozen String: "[FILTERED]").

The problem is that we want to .gsub! a string which was already filtered before and that then causes the error.

This PR fixes that and makes sure to scrub only auth headers which are not already scrubbed.