Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354397 - RewriteRegexRule fails if replacement url contains '$' characters
Summary: RewriteRegexRule fails if replacement url contains '$' characters
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 8.0.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 7.5.x   Edit
Assignee: Michael Gorovoy CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 11:29 EDT by Peter Balsiger CLA
Modified: 2011-08-24 13:20 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.