Steven Brown

Jaxer Bug: Query String Parsing on Rewrite Pages

by on Dec.26, 2008, under Jaxer

Jaxer doesn’t correctly populate Jaxer.request.data when the query string is modified by an Apache rewrite.

For example with the following rules:

RewriteRule ^(([^\/]+\/)*[^\/\.]+)\/?$ index.html?path=$1/ [QSA]
RewriteRule ^somecontroller/(.*) /anothercontroller/$1 [NC,L]

When accessing the following URL:

http://www.somedomain.com/somecontroller/whatever/

In this case Jaxer.request.data["path"] should be:

somecontroller/whatever/

Instead it is undefined. It appears the data is populated from Jaxer.request.current instead of Jaxer.request.queryString.

I propose the following fix:

Line 12767 of serverFramework.js is:

for (var p in this.current.queryParts)
{
    data[p] = this.current.queryParts[p];
}

I believe this should instead be:

var queryParts = Util.Url.queryToHash(this.queryString);
for (var p in queryParts)
{
    data[p] = queryParts[p];
}

I have applied this change to my own installation and it works correctly although I am not sure if it causes problems elsewhere.

Folow this bug at http://support.aptana.com/asap/browse/JXR-411


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!