[ jetty-Bugs-1251170 ] Character Encoding

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ jetty-Bugs-1251170 ] Character Encoding

SourceForge.net
Bugs item #1251170, was opened at 2005-08-03 17:09
Message generated for change (Settings changed) made by gregwilkins
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107322&aid=1251170&group_id=7322

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: HTTP protocol
Group: None
Status: Open
Resolution: Fixed
Priority: 5
Submitted By: Lars Borup Jensen (lborupj)
>Assigned to: Greg Wilkins (gregwilkins)
Summary: Character Encoding

Initial Comment:
I've come across a scenario where the HttpMessage seems
to wrongly parse the encoding part of the Content-Type
header.
When using Microsoft .NET C# to send a SOAP request to
a servlet deployed in Jetty 5.1.4, the .NET framework
adds yet another parameter to the Content-Type header
which then seems to confuse the HttpMessage parsing of
same.

This is the Content-Type as send by .NET

Content-Type: application/soap+xml; charset=utf-8;
action="http://example.com/GetLastTradePrice"

The HTTP/1.1 spec seem to allow multiple parameters (AFAIK)

This snippet is from the HttpMessage.java file, where I
think the problem may lay.

               // Look for charset
                int i1=contentType.indexOf("charset=",i0);
                if (i1>=0)
                {
                    i1+=8;
                    int i2 = contentType.indexOf(' ',i1);
                    _characterEncoding = (0<i2)
                        ? contentType.substring(i1,i2)
                        : contentType.substring(i1);
                    _characterEncoding =
QuotedStringTokenizer.unquote(_characterEncoding);
                }

As you can see, the characterEncoding will be e.g.
"utf-8;" with the semicolon at the end, which then
produces an exception as the VM cannot recognize such
an encoding (when creating a reader using
request.getReader()),"utf-8" would be correct I think..

/Lars Borup Jensen
Email: lars.borup (at) email.dk

----------------------------------------------------------------------

Comment By: Greg Wilkins (gregwilkins)
Date: 2005-08-24 08:51

Message:
Logged In: YES
user_id=44062

Fixed in CVS thanks.


----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107322&aid=1251170&group_id=7322


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss