Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Http request header that contains horizontal tab in value couldn't parse.

Seems like a bug.
Filed at https://bugs.eclipse.org/bugs/show_bug.cgi?id=423695

<HT> is an extremely uncommon separator in the wild btw.



--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Tue, Dec 10, 2013 at 3:40 AM, Terada Michitaka <terrada3@xxxxxxxxx> wrote:
Hi.

I'm developing a application with embedded Jetty.
That version is  9.0.5.
 
My application has REST interfaces those are built on the Jersey Framework.

I sent a http request to my application, and I got a following exception.

2013-12-10 16:10:44.973:WARN:oejh.HttpParser:qtp737096233-67: oejh.HttpParser#parseNext(HttpParser.java:1348):BadMessage: 400 Illegal character for HttpChannelOverHttp@3be20e53{r=1,a=IDLE,uri=-}
2013-12-10 16:10:44.973:DBUG:oejh.HttpParser:qtp737096233-67: oejh.HttpParser#parseNext(HttpParser.java:1350):
org.eclipse.jetty.http.HttpParser$BadMessage
at org.eclipse.jetty.http.HttpParser.parseHeaders(HttpParser.java:1123)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1194)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:212)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)
at java.lang.Thread.run(Thread.java:722)


This request contains a header below.

  field-name: value1<HT>value2

"<HT>"  means horizontal tab.

In the RFC2616, A field-value contains separators.

       message-header = field-name ":" [ field-value ]
       field-name     = token
       field-value    = *( field-content | LWS )
       field-content  = <the OCTETs making up the field-value
                        and consisting of either *TEXT or combinations
                        of token, separators, and quoted-string>

       separators     = "(" | ")" | "<" | ">" | "@"
                      | "," | ";" | ":" | "\" | <">
                      | "/" | "[" | "]" | "?" | "="
                      | "{" | "}" | SP | HT

So, I think that this request may be processed without a exception.

Have anybody tips or options to avoid this exception?
Is this a bug?

//Michitaka Terada 

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



Back to the top