lib/httpx/plugins/webdav.rb in httpx-0.22.5 vs lib/httpx/plugins/webdav.rb in httpx-0.23.0

- old
+ new

@@ -8,15 +8,15 @@ # https://gitlab.com/honeyryderchuck/httpx/wikis/WEBDAV # module WebDav module InstanceMethods def copy(src, dest) - request(:copy, src, headers: { "destination" => @options.origin.merge(dest) }) + request("COPY", src, headers: { "destination" => @options.origin.merge(dest) }) end def move(src, dest) - request(:move, src, headers: { "destination" => @options.origin.merge(dest) }) + request("MOVE", src, headers: { "destination" => @options.origin.merge(dest) }) end def lock(path, timeout: nil, &blk) headers = {} headers["timeout"] = if timeout && timeout.positive? @@ -28,11 +28,11 @@ "<D:lockinfo xmlns:D=\"DAV:\">" \ "<D:lockscope><D:exclusive/></D:lockscope>" \ "<D:locktype><D:write/></D:locktype>" \ "<D:owner>null</D:owner>" \ "</D:lockinfo>" - response = request(:lock, path, headers: headers, xml: xml) + response = request("LOCK", path, headers: headers, xml: xml) return response unless response.is_a?(Response) return response unless blk && response.status == 200 @@ -44,15 +44,15 @@ unlock(path, lock_token) end end def unlock(path, lock_token) - request(:unlock, path, headers: { "lock-token" => lock_token }) + request("UNLOCK", path, headers: { "lock-token" => lock_token }) end def mkcol(dir) - request(:mkcol, dir) + request("MKCOL", dir) end def propfind(path, xml = nil) body = case xml when :acl @@ -62,16 +62,16 @@ '<?xml version="1.0" encoding="utf-8"?><DAV:propfind xmlns:DAV="DAV:"><DAV:allprop/></DAV:propfind>' else xml end - request(:propfind, path, headers: { "depth" => "1" }, xml: body) + request("PROPFIND", path, headers: { "depth" => "1" }, xml: body) end def proppatch(path, xml) body = "<?xml version=\"1.0\"?>" \ "<D:propertyupdate xmlns:D=\"DAV:\" xmlns:Z=\"http://ns.example.com/standards/z39.50/\">#{xml}</D:propertyupdate>" - request(:proppatch, path, xml: body) + request("PROPPATCH", path, xml: body) end # %i[ orderpatch acl report search] end end register_plugin(:webdav, WebDav)