Skip to content

Commit

Permalink
Changed function parseUrlEncodedForm to accept form/query strings tha…
Browse files Browse the repository at this point in the history
…t contain no equal sign or an incomplete key value pair instead of throwing an exception. Keys not terminated with an equal sign will be parsed with an empty value string.
  • Loading branch information
Jan Krüger committed Jul 24, 2012
1 parent 39ef496 commit 060663f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/vibe/http/form.d
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ void parseUrlEncodedForm(string str, ref string[string] params)
while(str.length > 0){
// name part
auto idx = str.indexOf('=');
enforce(idx > 0, "Expected ident=value.");
if( idx == -1 ) {
params[urlDecode(str[0 .. $])] = "";
return;
}
string name = urlDecode(str[0 .. idx]);
str = str[idx+1 .. $];

Expand Down

0 comments on commit 060663f

Please sign in to comment.