http_request.rb 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Changelog +3 -0
  2. data/README.rdoc +1 -1
  3. data/lib/http_request.rb +8 -6
  4. metadata +2 -2
data/Changelog CHANGED
@@ -1,3 +1,6 @@
1
+ v1.1.2
2
+ * fixed a bug of redirection
3
+
1
4
  v1.1.1
2
5
  * using String#each_line instead of String#each, because ruby 1.9 doesn't have the method String#each
3
6
 
data/README.rdoc CHANGED
@@ -227,7 +227,7 @@ download multiple files from a directory
227
227
  bug fixing, testing and testing...
228
228
 
229
229
  == LATEST VERSION
230
- 1.1.1
230
+ 1.1.2
231
231
 
232
232
  == Author
233
233
 
data/lib/http_request.rb CHANGED
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # == Version
13
13
  #
14
- # v1.1.1
14
+ # v1.1.2
15
15
  #
16
16
  # Last Change: 15 Oct, 2009
17
17
  #
@@ -32,7 +32,7 @@ class HttpRequest
32
32
  include Singleton
33
33
  class << self
34
34
  # version
35
- VERSION = '1.1.1'.freeze
35
+ VERSION = '1.1.2'.freeze
36
36
  def version;VERSION;end
37
37
 
38
38
  # avaiabled http methods
@@ -368,10 +368,12 @@ class HttpRequest
368
368
  # GO !!
369
369
  if @options[:method] =~ /^(get|head|options|delete|move|copy|trace|)$/
370
370
  @options[:parameters] = "?#{@options[:parameters]}" if @options[:parameters]
371
- h = http.method(@options[:method]).call(
372
- "#{@uri.path}#{@options[:parameters] unless @options[:parameters].eql?('?')}",
373
- @headers
374
- )
371
+ path = if @options[:parameters] =~ /^\?+$/
372
+ @uri.path
373
+ else
374
+ @uri.path + @options[:parameters]
375
+ end
376
+ h = http.method(@options[:method]).call(path, @headers)
375
377
  else
376
378
  h = http.method(@options[:method]).call(@uri.path, @options[:parameters], @headers)
377
379
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_request.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - xianhua.zhou
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-15 00:00:00 +08:00
12
+ date: 2009-11-26 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15