From b3de719cf03dc236ca4e2445adbf82ec6b306b1a Mon Sep 17 00:00:00 2001
From: Brian Collins <brian@gastownlabs.com>
Date: Sun, 9 May 2010 14:27:44 -0700
Subject: [PATCH] fix urlencoding in net/http
---
lib/net/http.rb | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/net/http.rb b/lib/net/http.rb
index e96de9e..fe39c96 100644
|
a
|
b
|
|
| 1526 | 1526 | private :encode_kvpair |
| 1527 | 1527 | |
| 1528 | 1528 | def urlencode(str) |
| 1529 | | str.dup.force_encoding('ASCII-8BIT').gsub(/[^a-zA-Z0-9_\.\-]/){'%%%02x' % $&.ord} |
| | 1529 | enc = defined?(NSUTF8StringEncoding) ? NSUTF8StringEncoding : 4 |
| | 1530 | str.stringByAddingPercentEscapesUsingEncoding enc |
| 1530 | 1531 | end |
| 1531 | 1532 | private :urlencode |
| 1532 | 1533 | |