Improves handling of forwarded headers. Fix #2094

Should I change it? Or let this be for the time being...