Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345647 - Ext-B characters in servlet parameters are not decoded correctly
Summary: Ext-B characters in servlet parameters are not decoded correctly
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 7.2.x   Edit
Assignee: Greg Wilkins CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 306920 343643
  Show dependency tree
 
Reported: 2011-05-12 15:17 EDT by Chris Goldthorpe CLA
Modified: 2011-05-13 13:04 EDT (History)
2 users (show)

See Also:


Attachments
JUnit test plug-in (6.89 KB, application/zip)
2011-05-12 15:21 EDT, Chris Goldthorpe CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Goldthorpe CLA 2011-05-12 15:17:30 EDT
Eclipse SDK I20110511-0800

If a servlet is called with parameters which contain encoded Ext-B characters getParameter() does not decode the parameters correctly. I will attach a JUnit test which can be run against Eclipse which illustrates the problem.
Comment 1 Chris Goldthorpe CLA 2011-05-12 15:21:18 EDT
Created attachment 195532 [details]
JUnit test plug-in

When the attached tests are run in Eclipse testExtBCharacter2A6D5() and testExtBCharacter20008() both fail, all other tests pass.
Comment 2 Simon Kaegi CLA 2011-05-12 16:11:10 EDT
Chris, one thought here... this is on Jetty 6.1 correct?

Does anyone know if this is fixed in Jetty 7? If so the fix on our side would be to move up to 7.1 or 7.2.
Comment 3 Chris Goldthorpe CLA 2011-05-12 16:16:32 EDT
Yes, it's on Jetty 6.1.
Comment 4 Greg Wilkins CLA 2011-05-12 22:59:02 EDT
I have added the following test to HttpURITest:


    @Test
    public void testExtB() throws Exception
    {
        for (String value: new String[]{"a","abcdABCD","\u00C0","\u697C","\uD869\uDED5","\uD840\uDC08"} )
        {
            HttpURI uri = new HttpURI("/path?value="+URLEncoder.encode(value,"UTF-8"));
            
            MultiMap<String> parameters = new MultiMap<String>();
            uri.decodeQueryTo(parameters,"UTF-8");
            assertEquals(value,parameters.get("value"));
        }
    }

This passes in jetty-7.4.1 and jetty-6 trunk.

So this bug has been fixed. 

Currently there is no immediate plans for another jetty-6 release, but is somebody has some spare cycles to help us get it CQ'd etc then we could consider a maintenance release in the next few weeks.
Comment 5 Chris Goldthorpe CLA 2011-05-13 12:29:48 EDT
Thanks for turning this around so quickly. For Eclipse 3.8 we would presumably move up to Jetty 7.x, for Eclipse 3.7 users a new Jetty 6 release would be the ideal solution.
Comment 6 Simon Kaegi CLA 2011-05-13 13:04:27 EDT
Thanks Greg,

I feel doubly guilty for not being on 7.x yet. If you cut a maintenance release for 6.x I'd be more than happy to do the CQ.