From: Cornelius Schumacher
---
docs/api/rest_test.rb | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/docs/api/rest_test.rb b/docs/api/rest_test.rb
index eb5bbcc..11aca68 100644
--- a/docs/api/rest_test.rb
+++ b/docs/api/rest_test.rb
@@ -107,6 +107,15 @@ class TestContext
response = Net::HTTP.start( host ) do |http|
http.request( req )
end
+ if ( response.is_a? Net::HTTPRedirection )
+ location = URI.parse response["location"]
+ puts " Redirected to #{location}"
+ req = Net::HTTP::Get.new( location.path )
+ req.basic_auth( @user, @password )
+ response = Net::HTTP.start( location.host, location.port ) do |http|
+ http.request( req )
+ end
+ end
else
STDERR.puts " Test of method '#{request.verb}' not supported yet."
unsupported
--
1.7.7
--
To unsubscribe, e-mail: obs-commits+unsubscribe@opensuse.org
To contact the owner, e-mail: obs-commits+owner@opensuse.org