Packetbeat cannot parse Tomcat's response status line because of reason phrase

I tried to use Packetbeat 6.2.2 to capture packets of Tomcat request / response but failed to capture with this error.

http/http_parser.go(156) Failed to understand HTTP response status: 200

Tomcat (> 8.5) returns only the response status code without reason phrase by default, but packetbeat's parser expects the reason phrase and it cause above error. I think the spec of HTTP 1.1 (RFC 2616) is ambiguous regarding whether the reason phrase is optional or required. I think a "space" is required, but the "phrase" is not required.

RFC 2616

Then, is it reasonable to modify Packetbeat to be enabled to parse the response status line without any reason phrase?

Hmmm.... this sounds somewhat familiar to me. If servers do give this kind of response-code-only-response, packetbeat should support this. Do you plan to create a pull request? Otherwise, just open an issue.

A fix for this was already merged (#6208) but we have failed to backport it to 6.2.

1 Like

The fix won't make it to 6.2.3, but it will be available in the next version, most likely 6.3.0

Thanks, I'm grad to here that. I'll wait for 6.3!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.