fixed failing unit test with HTTP::Headers >= 6.05
extended and refactored option 'when' and documentation