Permalink
Browse files

for v1.1.2, fixed a bug of redirection

  • Loading branch information...
1 parent 876cc1a commit 1d3ae5c878a5492576aaf97f49ef5c2a54c1bddb zhou xianhua committed Nov 26, 2009
Showing with 13 additions and 8 deletions.
  1. +3 −0 Changelog
  2. +1 −1 README.rdoc
  3. +1 −1 http_request.gemspec
  4. +8 −6 lib/http_request.rb
View
@@ -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
@@ -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
@@ -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
@@ -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

0 comments on commit 1d3ae5c

Please sign in to comment.