Skip to content

Commit

Permalink
Minor code cleanup #441
Browse files Browse the repository at this point in the history
Also add credit to John Whish for URL-encoded form data.
  • Loading branch information
seancorfield committed Jul 11, 2016
1 parent e6ec36d commit a3347f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion framework/one.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -2773,6 +2773,8 @@ component {
if ( variables.framework.enableJSONPOST ) {
// thanks to Adam Tuttle and by proxy Jason Dean and Ray Camden for the
// seed of this code, inspired by Taffy's basic deserialization
// also thanks to John Whish for the URL-encoded form support
// which adds support for PUT etc
var body = httpData.content;
if ( isBinary( body ) ) body = charSetEncode( body, "utf-8" );
if ( len( body ) ) {
Expand All @@ -2790,7 +2792,7 @@ component {
case "application/x-www-form-urlencoded":
try {
var paramPairs = listToArray( body, "&" );
for (var pair in paramPairs) {
for ( var pair in paramPairs ) {
var parts = listToArray( pair, "=", true ); // handle blank values
request.context[ parts[ 1 ] ] = urlDecode( parts[ 2 ] );
}
Expand Down

0 comments on commit a3347f7

Please sign in to comment.