Browse files

Encode null/undefined values as blank strings in request params

  • Loading branch information...
1 parent 31cad7e commit 7913db687274778ba45a62636d9c2254c9c26495 @jamesmacaulay jamesmacaulay committed Mar 19, 2012
Showing with 2 additions and 0 deletions.
  1. +1 −0 src/batman.solo.coffee
  2. +1 −0 src/extras/batman.rails.coffee
View
1 src/batman.solo.coffee
@@ -400,6 +400,7 @@ param = (a) ->
s = []
add = (key, value) ->
value = value() if typeof value is 'function'
+ value = '' unless value?
s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value)
if Batman.typeOf(a) is 'Array'
View
1 src/extras/batman.rails.coffee
@@ -17,6 +17,7 @@ applyExtra = (Batman) ->
s = []
add = (key, value) ->
value = value() if typeof value is 'function'
+ value = '' unless value?
s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value)
if Batman.typeOf(a) is 'Array'

0 comments on commit 7913db6

Please sign in to comment.