Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

bug #19234 : cookie path checking broken - Fixed.

  • Loading branch information...
commit 957bf336a107cc8e86831e0d2edca881408c5fb8 1 parent 5a2f958
John Mettraux authored April 01, 2008
7  lib/rufus/verbs/endpoint.rb
@@ -183,6 +183,11 @@ def request (method, args, &block)
183 183
 
184 184
             # handle response
185 185
 
  186
+            class << res
  187
+                attr_accessor :request
  188
+            end
  189
+            res.request = req
  190
+
186 191
             vlog_response opts, res
187 192
 
188 193
             register_cookies res, opts
@@ -445,6 +450,8 @@ def compute_path (opts)
445 450
                     path += "/#{i}" if i
446 451
                 end
447 452
 
  453
+                path = path[1..-1] if path[0..1] == '//'
  454
+
448 455
                 query = opts[:query] || opts[:params]
449 456
 
450 457
                 return path if not query or query.size < 1
10  lib/rufus/verbs/verbose.rb
@@ -43,6 +43,16 @@ module VerboseMixin
43 43
         protected
44 44
 
45 45
             #
  46
+            # logs a unique message to the verbose channel (if any).
  47
+            #
  48
+            def vlog (opts, msg)
  49
+
  50
+                channel = get_channel(opts) or return
  51
+
  52
+                channel << msg
  53
+            end
  54
+
  55
+            #
46 56
             # logs the outgoing request
47 57
             #
48 58
             def vlog_request (opts, req)
2  test/dryrun_test.rb
@@ -63,7 +63,7 @@ def test_1
63 63
         req = ep.post(
64 64
             :dry_run => true,
65 65
             :resource => 'other',
66  
-            :params => { 'a' => 'A', 'b' => 'B' })
  66
+            :query => { 'a' => 'A', 'b' => 'B' })
67 67
         
68 68
         assert_equal "/other?a=A&b=B", req.path
69 69
     end

0 notes on commit 957bf33

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