java - Header parse error after upgrade to Jetty 9.3 -
i'm having issue when change jetty distro 9.2 9.3. under 9.2 app works flawlessly when running same war file , connecting same client following error messages when running under 9.3:
015-08-30 14:55:32.174:warn:oejh.httpparser:qtp1100439041-12: illegal character 0x20 in state=header_in_name buffer heapbytebuffer@26dab36[p=62,l=654,c=8192,r=592]={post /api/v1/time...0.1:8080\r\nkey <<<info header: ...erica/toronto"}>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2015-08-30 14:55:32.175:warn:oejh.httpparser:qtp1100439041-12: bad http parsed: 400 illegal character 0x20 httpchanneloverhttp@6765bf81{r=0,c=false,a=idle,uri=-}
from understand, there illegal character in header, why 1 version throw error , other not?
also using apache httpclient 4.4.1 send data.
the upgrade jetty 9.2 9.3 meant entered in new world of http/1.1 updated specs , rfcs, , new http/2 requirements, including changes http/1.1 support http/2 upgrade (h2c).
jetty 9.2 followed rfc2616 (now obsoleted by: rfc7230, rfc7231, rfc7232, rfc7233, rfc7234, rfc7235 , updated by: rfc2817, rfc5785, rfc6266, rfc6585)
jetty 9.3 follows updates venerable (from 1999!) rfc2616 spec. many things valid in past no longer valid. dropped support http/0.9 in jetty 9.3
there many parts of http/1.1 tidied take advantage of updated rfcs, of them might have bit you.
looking @ spec, rfc7230: section 3.2 - header fields, see header field declared as...
header-field = field-name ":" ows field-value ows field-name = token field-value = *( field-content / obs-fold ) field-content = field-vchar [ 1*( sp / htab ) field-vchar ] field-vchar = vchar / obs-text obs-fold = crlf 1*( sp / htab ) ; obsolete line folding ; see section 3.2.4
with token
defined in rfc7230: appendix b - collected abnf ...
tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" / digit / alpha token = 1*tchar
which means " "
(space) in "info header:"
invalid per spec.
it better if "info-header"
or more accurately following spec "x-info-header"
(so not conflict spec reserved header names)
incidentally, space in header name valid in http/0.9 (not anymore).
Comments
Post a Comment