bin/dav in net_dav-0.2.2 vs bin/dav in net_dav-0.3.0
- old
+ new
@@ -4,10 +4,13 @@
require 'rubygems'
require 'net/dav'
dav_user = ENV['DAVUSER']
dav_pass = ENV['DAVPASS']
+disable_basic_auth = (ENV['DISABLE_BASIC_AUTH'] && ENV['DISABLE_BASIC_AUTH'] != "0")
+enable_curl = !(ENV['DISABLE_CURL'] && ENV['DISABLE_CURL'] != "0")
+
cmd = $*[0]
def print_usage
puts "usage: #{$0} COMMAND [ARGS]"
puts ""
@@ -34,12 +37,11 @@
file = $*[2]
else
url = URI.parse $*[1]
end
-enable_curl = !(ENV['DISABLE_CURL'] && ENV['DISABLE_CURL'] != "0")
-
dav = Net::DAV.new(url, :curl => enable_curl)
+dav.disable_basic_auth = disable_basic_auth
if (url.scheme == 'https')
dav.verify_callback = lambda do |preverify_ok, x509_store|
puts "preverify = #{preverify_ok}" if $DEBUG
puts "cert = #{x509_store.current_cert.inspect}" if $DEBUG