hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Senduran <bsendu...@gmail.com>
Subject Handling 204 Response with Body
Date Fri, 25 Mar 2016 10:59:27 GMT
Hi all,

Some backend responses the '204 No content' status code with body (yes,
clearly spec violation)
In our targetHandler
we check(isResponseHaveBodyExpected) for some status code (204, 205 and
304) and assumes those will not contain body and continue the rest. Once we
find those status code we call resetInput()
it didn't clear the sessionInputBuffer)

Every thing works fine, unless such spec violation happens. Once the 204
comes with a message body, the sessionInputBuffer is filled with the
content. and no one will consume it. So when the 2nd response comes (using
the same connection) it will use the same session input buffer and will get
a corrupted data. (in this case we are getting protocol violation
exception, since the 1st 204 response's body is prepended to the 2nd
response's status line)

What would be best way to fix this


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message