Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354397

Summary: RewriteRegexRule fails if replacement url contains '$' characters
Product: [RT] Jetty Reporter: Peter Balsiger <balsiger>
Component: serverAssignee: Michael Gorovoy <mgorovoy>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: jetty-inbox, mgorovoy
Version: 8.0.0   
Target Milestone: 7.5.x   
Hardware: All   
OS: All   
Whiteboard:

Description Peter Balsiger CLA 2011-08-10 11:29:26 EDT
When using a rewrite regex rule, having a '$' in the URL fails with a 'illegal group' IllegalArgumentException. 
To fix this, line 57 should be changed fom

            String group = matcher.group(g);

to
            String group = Matcher.quoteReplacement(matcher.group(g));

(at least this works afterwards for me).
Comment 1 Michael Gorovoy CLA 2011-08-15 12:30:36 EDT
Committed the fix and the unit test for this issue to Jetty 7.5.x master. 

This fix will be merged to Jetty 8.x during the next merge cycle. I'm going to keep this ticket open till the merge happens, that should be done very soon as 8.0.0.RC0 build is forthcoming.
Comment 2 Michael Gorovoy CLA 2011-08-24 13:20:23 EDT
This fix been merged into jetty-8 branch, marking as resolved.