Bug 50286 - URL Re-writing Modifier: extracted jsessionid value is incorrect when is between XML tags
Summary: URL Re-writing Modifier: extracted jsessionid value is incorrect when is betw...
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.4
Hardware: All All
: P2 major (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-17 10:39 UTC by Gregory Lardiere
Modified: 2010-11-22 06:45 UTC (History)
0 users



Attachments
Patch (2.14 KB, patch)
2010-11-17 10:41 UTC, Gregory Lardiere
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gregory Lardiere 2010-11-17 10:39:18 UTC
When extracted from an XML document, the jsessionid value might contains extra characters. For example, with this XML : "<url>/some/path;jsessionid=123456789</url>", the extracted jsessionid is "123456789</url".
The attached patch fixes the problem by excluding the "<" character from the list of allowed characters for a jsessionid value.
Comment 1 Gregory Lardiere 2010-11-17 10:41:06 UTC
Created attachment 26305 [details]
Patch
Comment 2 Milamber 2010-11-19 16:08:52 UTC
Thanks for report and patch. Done in SVN

URL: http://svn.apache.org/viewvc?rev=1037021&view=rev
Log:
Bug 50286 - URL Re-writing Modifier: extracted jsessionid value is incorrect when is between XML tags

Modified:
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/URLRewritingModifier.java
    jakarta/jmeter/trunk/xdocs/changes.xml
Comment 3 Sebb 2010-11-20 12:56:01 UTC
I'm not sure this is fully solved. At least there needs to be a test case.

So I wrote a test case - but it failed because it does not use any of the REs that have been patched. Instead it uses parameterRegexp.

@Gregory: Does your test use Path Extension = true?
Not sure how that could be using that for the example you gave.
Comment 4 Sebb 2010-11-20 15:34:14 UTC
(In reply to comment #3)

> Not sure how that could be using that for the example you gave.

Scrub that sentence - does not apply.
Comment 5 Milamber 2010-11-20 16:32:57 UTC
The solve wouldn't be adding a < in parameterRegexp?

        parameterRegexp = JMeterUtils.getPatternCache().getPattern(
                // ;sessionid=value
                "[;\\?&]" + quotedArg + "=([^\"'>&\\s;\\\\]*)" +  // $NON-NLS-1$
Comment 6 Gregory Lardiere 2010-11-22 04:42:58 UTC
(In reply to comment #3)
> @Gregory: Does your test use Path Extension = true?

yes, my test uses PathExtension=true and PathExtensionNoQuestionmark=true
Comment 7 Gregory Lardiere 2010-11-22 04:51:06 UTC
(In reply to comment #5)
> The solve wouldn't be adding a < in parameterRegexp?

My patch solves the problem in my case (PathExtension=true).
The same problem may exists as well in the "PathExtension=false" case, I didn't checked.
Comment 8 Sebb 2010-11-22 06:45:56 UTC
Thanks for confirming your settings.

Code has now also been fixed for the PathExtension=false case.
Comment 9 The ASF infrastructure team 2022-09-24 20:37:45 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2427