Jetty

URL decoding of spaces (+) fails for encoding not utf8

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 6.1.14
  • Fix Version/s: 6.1.15.pre0
  • Component/s: HTTP
  • Labels:
    None
  • Environment:
    OS: Debian GNU/Linux lenny.
    Java: Sun 1.6.0_11-b03 (x86-64)
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

If a + char (should be decoded as space) comes after antoher %-encoded char when decoding charset is not UTF-8, then it will fail. It will output + instead of space.

Attached is patch with fix and testcase.

Activity

Hide
David Yu added a comment -

Thanks for detecting the bug.

It actually needs more handling:

"%+1" <-- throws a java.lang.NumberFormatException

Will fix.

Show
David Yu added a comment - Thanks for detecting the bug. It actually needs more handling: "%+1" <-- throws a java.lang.NumberFormatException Will fix.
Hide
David Yu added a comment -

Actually, a new jira (JETTY-825) is created for the NFE handling.
Patch commited.

Thanks

Show
David Yu added a comment - Actually, a new jira (JETTY-825) is created for the NFE handling. Patch commited. Thanks

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: