#716 bug
Mike Nelson

toQueryString & IIS / ASP

Reported by Mike Nelson | June 18th, 2009 @ 07:21 PM

Not sure if this is an IIS specific issue. This seems to only

If you have a query string with one of the values undefined then prototype's toQueryString() will format it in a way that the next key/value on the string will be read incorrectly in ASP.

var a, b, c;
var qs = {"a":a,"b":b,"c":c}.toQueryString();
qs turns out to be "a=stuff&b&c=moreStuff", which ISS / ASP parses into,
a -> stuff
b&c -> moreStuff
Attached a patch to fix this. This makes the above example, "a=stuff&b=&c=moreStuff" which parses as expected in IIS / ASP.

Although, this seems like this is very intentional to format the query string like it is now. Indeed it breaks some tests for toQueryString. I couldn't find a reference to this in the URI RFC's where that you can have a key without an equal character following. This seems to be outside of the RFC's. But without this patch it seems to break in ASP. I am not sure of what the the current use of sending "b&c&d" would be.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket