Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

for v1.1.2, fixed a bug of redirection

  • Loading branch information...
commit 1d3ae5c878a5492576aaf97f49ef5c2a54c1bddb 1 parent 876cc1a
zhou xianhua authored
View
3  Changelog
@@ -1,3 +1,6 @@
+v1.1.2
+ * fixed a bug of redirection
+
v1.1.1
* using String#each_line instead of String#each, because ruby 1.9 doesn't have the method String#each
View
2  README.rdoc
@@ -227,7 +227,7 @@ download multiple files from a directory
bug fixing, testing and testing...
== LATEST VERSION
- 1.1.1
+ 1.1.2
== Author
View
2  http_request.gemspec
@@ -3,7 +3,7 @@ SPEC=Gem::Specification.new do |s|
s.homepage = 'http://my.cnzxh.net'
s.rubyforge_project = "http_request.rb"
s.name = 'http_request.rb'
- s.version = '1.1.1'
+ s.version = '1.1.2'
s.author = 'xianhua.zhou'
s.email = 'xianhua.zhou@gmail.com'
s.platform = Gem::Platform::RUBY
View
14 lib/http_request.rb
@@ -11,7 +11,7 @@
#
# == Version
#
-# v1.1.1
+# v1.1.2
#
# Last Change: 15 Oct, 2009
#
@@ -32,7 +32,7 @@ class HttpRequest
include Singleton
class << self
# version
- VERSION = '1.1.1'.freeze
+ VERSION = '1.1.2'.freeze
def version;VERSION;end
# avaiabled http methods
@@ -368,10 +368,12 @@ def send_request(http)
# GO !!
if @options[:method] =~ /^(get|head|options|delete|move|copy|trace|)$/
@options[:parameters] = "?#{@options[:parameters]}" if @options[:parameters]
- h = http.method(@options[:method]).call(
- "#{@uri.path}#{@options[:parameters] unless @options[:parameters].eql?('?')}",
- @headers
- )
+ path = if @options[:parameters] =~ /^\?+$/
+ @uri.path
+ else
+ @uri.path + @options[:parameters]
+ end
+ h = http.method(@options[:method]).call(path, @headers)
else
h = http.method(@options[:method]).call(@uri.path, @options[:parameters], @headers)
end
Please sign in to comment.
Something went wrong with that request. Please try again.