minor fixes
This commit is contained in:
parent
24c26f957f
commit
9a8e7fa0d8
1 changed files with 8 additions and 2 deletions
|
|
@ -63,11 +63,16 @@ def fetch(uri_str, limit = 10)
|
|||
raise ArgumentError, 'HTTP redirect too deep' if limit == 0
|
||||
|
||||
host = URI.parse(uri_str).host
|
||||
port = URI.parse(uri_str).port
|
||||
path = URI.parse(uri_str).path
|
||||
query = URI.parse(uri_str).query
|
||||
|
||||
Net::HTTP.start(host) {|http|
|
||||
req = Net::HTTP::Get.new("#{path}?#{query}")
|
||||
Net::HTTP.start(host, port) {|http|
|
||||
if query
|
||||
req = Net::HTTP::Get.new("#{URI.escape(path)}?#{URI.escape(query)}")
|
||||
else
|
||||
req = Net::HTTP::Get.new("#{URI.escape(path)}")
|
||||
end
|
||||
req.basic_auth @user, @pass
|
||||
response = http.request(req)
|
||||
case response
|
||||
|
|
@ -110,6 +115,7 @@ end
|
|||
|
||||
def cvsparse(url)
|
||||
puts "\n#{url}"
|
||||
body=[]
|
||||
begin
|
||||
body = fetch("#{url}/CVS/Entries").body
|
||||
rescue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue