Improves handling of forwarded headers. Fix #2094
Merge pull request #3490 from martinpallmann/issue-2094

Improves handling of forwarded headers. Fix #2094