Skip to content
Browse files

urlencode square brackets

  • Loading branch information...
1 parent 94bcd65 commit 4d1b8bed5a9dd5173668e670c759dea25647a896 @micha committed Aug 3, 2009
Showing with 3 additions and 2 deletions.
  1. +1 −1 pp
  2. +2 −1 resty
View
2 pp
@@ -1 +1 @@
-perl -0007 -MJSON -nE'say to_json(from_json($_, {allow_nonref=>1}),{pretty=>1})' 2>/dev/null
+perl -0007 -MJSON -ne'print to_json(from_json($_, {allow_nonref=>1}),{pretty=>1})."\n"'
View
3 resty
@@ -20,7 +20,8 @@ function resty() {
local accp="Accept: application/json"
local uri opt dat res ret out err verbose raw i d tmpf
- [ -n "$1" ] && [ "${1#/}" != "$1" ] && uri="$1" && shift
+ [ -n "$1" ] && [ "${1#/}" != "$1" ] \
+ && uri=$(echo "$1"|sed 's/[\[]/%5B/g;s/[]]/%5D/g') && shift
[ -z "$method" ] && cat "$conf" 2>/dev/null && return
for i in "$@"; do

0 comments on commit 4d1b8be

Please sign in to comment.
Something went wrong with that request. Please try again.