UNDERTOW-22

Don't know the architecture of Undertow much so the fix may not be consistent with how the rest works. The testcase may come useful at least.