Skip to content
Myr

Added JSON body decoding spec

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 0892f6d · Browse files · 2 files+18 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+18 added−2 removed

  • tests:+9 added−0 removed
  • other:+9 added−2 removed

2 files+18 added−2 removed

modified:lib/express.core.js+9 added-2 removed
59 unmodified lines
60 61 BodyDecoder : {62 onRequest : {63 'parse urlencoded bodies' : function() {64 if (Express.requestHeader('Content-Type') == 'application/x-www-form-urlencoded')65 Express.request.uri.params = Express.parseParams(unescape(Express.request.body))64 switch (Express.requestHeader('Content-Type')) {65 case 'application/x-www-form-urlencoded':66 Express.request.uri.params = Express.parseParams(unescape(Express.request.body))67 break68 69 case 'application/json':70 Express.request.uri.params = Express.jsonDecode(Express.request.body)71 break72 }73 }74 }75 },76
603 unmodified lines
modified:spec/spec.core.js+9 added