@@ -180,7 +180,7 @@ def test_BASIC_auth_force
180180 c . www_auth . basic_auth . instance_eval { @scheme = "BASIC" }
181181 #
182182 c . force_basic_auth = true
183- c . debug_dev = str = ''
183+ c . debug_dev = str = '' . dup
184184 c . set_auth ( "http://localhost:#{ serverport } /" , 'admin' , 'admin' )
185185 assert_equal ( 'basic_auth OK' , c . get_content ( "http://localhost:#{ serverport } /basic_auth" ) )
186186 assert_equal ( 'Authorization: Basic YWRtaW46YWRtaW4=' . upcase , str . split ( /\r ?\n / ) [ 5 ] . upcase )
@@ -253,7 +253,7 @@ def test_basic_auth_reuses_credentials
253253 c . set_auth ( "http://localhost:#{ serverport } /" , 'admin' , 'admin' )
254254 assert_equal ( 'basic_auth OK' , c . get_content ( "http://localhost:#{ serverport } /basic_auth/" ) )
255255 c . test_loopback_http_response << "HTTP/1.0 200 OK\n Content-Length: 2\n \n OK"
256- c . debug_dev = str = ''
256+ c . debug_dev = str = '' . dup
257257 c . get_content ( "http://localhost:#{ serverport } /basic_auth/sub/dir/" )
258258 assert_match ( /Authorization: Basic YWRtaW46YWRtaW4=/ , str )
259259 end
@@ -269,7 +269,7 @@ def test_digest_auth_reuses_credentials
269269 c . set_auth ( "http://localhost:#{ serverport } /" , 'admin' , 'admin' )
270270 assert_equal ( 'digest_auth OK' , c . get_content ( "http://localhost:#{ serverport } /digest_auth/" ) )
271271 c . test_loopback_http_response << "HTTP/1.0 200 OK\n Content-Length: 2\n \n OK"
272- c . debug_dev = str = ''
272+ c . debug_dev = str = '' . dup
273273 c . get_content ( "http://localhost:#{ serverport } /digest_auth/sub/dir/" )
274274 assert_match ( /Authorization: Digest/ , str )
275275 end
@@ -315,7 +315,7 @@ def test_perfer_digest
315315 c . set_auth ( 'http://example.com/' , 'admin' , 'admin' )
316316 c . test_loopback_http_response << "HTTP/1.0 401 Unauthorized\n WWW-Authenticate: Basic realm=\" foo\" \n WWW-Authenticate: Digest realm=\" foo\" , nonce=\" nonce\" , stale=false\n Content-Length: 2\n \n NG"
317317 c . test_loopback_http_response << "HTTP/1.0 200 OK\n Content-Length: 2\n \n OK"
318- c . debug_dev = str = ''
318+ c . debug_dev = str = '' . dup
319319 c . get_content ( 'http://example.com/' )
320320 assert_match ( /^Authorization: Digest/ , str )
321321 end
@@ -331,7 +331,7 @@ def test_proxy_auth
331331 c . set_proxy_auth ( 'admin' , 'admin' )
332332 c . test_loopback_http_response << "HTTP/1.0 407 Unauthorized\n Proxy-Authenticate: Basic realm=\" foo\" \n Content-Length: 2\n \n NG"
333333 c . test_loopback_http_response << "HTTP/1.0 200 OK\n Content-Length: 2\n \n OK"
334- c . debug_dev = str = ''
334+ c . debug_dev = str = '' . dup
335335 c . get_content ( 'http://example.com/' )
336336 assert_match ( /Proxy-Authorization: Basic YWRtaW46YWRtaW4=/ , str )
337337 end
@@ -341,7 +341,7 @@ def test_proxy_auth_force
341341 c . set_proxy_auth ( 'admin' , 'admin' )
342342 c . force_basic_auth = true
343343 c . test_loopback_http_response << "HTTP/1.0 200 OK\n Content-Length: 2\n \n OK"
344- c . debug_dev = str = ''
344+ c . debug_dev = str = '' . dup
345345 c . get_content ( 'http://example.com/' )
346346 assert_match ( /Proxy-Authorization: Basic YWRtaW46YWRtaW4=/ , str )
347347 end
@@ -353,7 +353,7 @@ def test_proxy_auth_reuses_credentials
353353 c . test_loopback_http_response << "HTTP/1.0 200 OK\n Content-Length: 2\n \n OK"
354354 c . test_loopback_http_response << "HTTP/1.0 200 OK\n Content-Length: 2\n \n OK"
355355 c . get_content ( 'http://www1.example.com/' )
356- c . debug_dev = str = ''
356+ c . debug_dev = str = '' . dup
357357 c . get_content ( 'http://www2.example.com/' )
358358 assert_match ( /Proxy-Authorization: Basic YWRtaW46YWRtaW4=/ , str )
359359 end
@@ -367,7 +367,7 @@ def test_digest_proxy_auth_loop
367367 ha1 = md5 . hexdigest ( "admin:foo:admin" )
368368 ha2 = md5 . hexdigest ( "GET:/" )
369369 response = md5 . hexdigest ( "#{ ha1 } :nonce:#{ ha2 } " )
370- c . debug_dev = str = ''
370+ c . debug_dev = str = '' . dup
371371 c . get_content ( 'http://example.com/' )
372372 assert_match ( /Proxy-Authorization: Digest/ , str )
373373 assert_match ( %r"response=\" #{ response } \" " , str )
@@ -398,7 +398,7 @@ def test_prefer_digest_to_basic_proxy_auth
398398 ha1 = md5 . hexdigest ( "admin:foo:admin" )
399399 ha2 = md5 . hexdigest ( "GET:/" )
400400 response = md5 . hexdigest ( "#{ ha1 } :nonce:#{ ha2 } " )
401- c . debug_dev = str = ''
401+ c . debug_dev = str = '' . dup
402402 c . get_content ( 'http://example.com/' )
403403 assert_match ( /Proxy-Authorization: Digest/ , str )
404404 assert_match ( %r"response=\" #{ response } \" " , str )
@@ -415,7 +415,7 @@ def test_digest_proxy_auth_reuses_credentials
415415 ha2 = md5 . hexdigest ( "GET:/" )
416416 response = md5 . hexdigest ( "#{ ha1 } :nonce:#{ ha2 } " )
417417 c . get_content ( 'http://www1.example.com/' )
418- c . debug_dev = str = ''
418+ c . debug_dev = str = '' . dup
419419 c . get_content ( 'http://www2.example.com/' )
420420 assert_match ( /Proxy-Authorization: Digest/ , str )
421421 assert_match ( %r"response=\" #{ response } \" " , str )
@@ -437,19 +437,19 @@ def test_oauth
437437 c . www_auth . oauth . set_config ( 'http://photos.example.net/' , config )
438438 c . www_auth . oauth . challenge ( 'http://photos.example.net/' )
439439 c . test_loopback_http_response << "HTTP/1.0 200 OK\n Content-Length: 2\n \n OK"
440- c . debug_dev = str = ''
440+ c . debug_dev = str = '' . dup
441441 c . get_content ( 'http://photos.example.net/photos' , [ [ :file , 'vacation.jpg' ] , [ :size , 'original' ] ] )
442442 assert ( str . index ( %q(GET /photos?file=vacation.jpg&size=original) ) )
443443 assert ( str . index ( %q(Authorization: OAuth realm="http://photos.example.net/", oauth_consumer_key="dpf43f3p2l4k3l03", oauth_nonce="kllo9940pd9333jh", oauth_signature="tR3%2BTy81lMeYAr%2FFid0kMTYa%2FWM%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1191242096", oauth_token="nnch734d00sl2jdk", oauth_version="1.0") ) )
444444 #
445445 c . test_loopback_http_response << "HTTP/1.0 200 OK\n Content-Length: 2\n \n OK"
446- c . debug_dev = str = ''
446+ c . debug_dev = str = '' . dup
447447 c . get_content ( 'http://photos.example.net/photos?file=vacation.jpg&size=original' )
448448 assert ( str . index ( %q(GET /photos?file=vacation.jpg&size=original) ) )
449449 assert ( str . index ( %q(Authorization: OAuth realm="http://photos.example.net/", oauth_consumer_key="dpf43f3p2l4k3l03", oauth_nonce="kllo9940pd9333jh", oauth_signature="tR3%2BTy81lMeYAr%2FFid0kMTYa%2FWM%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1191242096", oauth_token="nnch734d00sl2jdk", oauth_version="1.0") ) )
450450 #
451451 c . test_loopback_http_response << "HTTP/1.0 200 OK\n Content-Length: 2\n \n OK"
452- c . debug_dev = str = ''
452+ c . debug_dev = str = '' . dup
453453 c . post_content ( 'http://photos.example.net/photos' , [ [ :file , 'vacation.jpg' ] , [ :size , 'original' ] ] )
454454 assert ( str . index ( %q(POST /photos) ) )
455455 assert ( str . index ( %q(Authorization: OAuth realm="http://photos.example.net/", oauth_consumer_key="dpf43f3p2l4k3l03", oauth_nonce="kllo9940pd9333jh", oauth_signature="wPkvxykrw%2BBTdCcGqKr%2B3I%2BPsiM%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1191242096", oauth_token="nnch734d00sl2jdk", oauth_version="1.0") ) )
@@ -479,7 +479,7 @@ def test_negotiate_and_basic
479479 c . test_loopback_http_response << %Q(HTTP/1.1 401 Unauthorized\r \n WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAACgAAAABAAAAAAAAAAAAAAA=\r \n Connection: Keep-Alive\r \n Content-Length: 0\r \n \r \n )
480480 c . test_loopback_http_response << %Q(HTTP/1.0 200 OK\r \n Connection: Keep-Alive\r \n Content-Length: 1\r \n \r \n a)
481481 c . test_loopback_http_response << %Q(HTTP/1.0 200 OK\r \n Connection: Keep-Alive\r \n Content-Length: 1\r \n \r \n b)
482- c . debug_dev = str = ''
482+ c . debug_dev = str = '' . dup
483483 c . set_auth ( 'http://www.example.org/' , 'admin' , 'admin' )
484484 # Do NTLM negotiation
485485 c . get ( 'http://www.example.org/foo' )
@@ -488,7 +488,7 @@ def test_negotiate_and_basic
488488 assert_match ( %r(Authorization: NTLM) , str )
489489 assert_not_match ( %r(Authorization: Basic) , str )
490490 # ditto for other resource that is protected with NTLM
491- c . debug_dev = str = ''
491+ c . debug_dev = str = '' . dup
492492 c . get ( 'http://www.example.org/foo/subdir' )
493493 assert_not_match ( %r(Authorization: NTLM) , str )
494494 assert_not_match ( %r(Authorization: Basic) , str )
0 commit comments