-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return current directory info on getDirectoryContents #178
Comments
Hi! Currently no, as this wouldn't make sense in the vast majority of use cases. You could use a custom request to handle this yourself, though. |
wrong link? You meant this? https://github.com/perry-mitchell/webdav-client#custom-requests |
@skjnldsv Sorry! Random clipboard data.. Thanks. If you come up with any ideas that you might want to explore here just let me know. Cheers :) |
hey @perry-mitchell :) I'd kindly ask you to re-open. A regular PROPFIND also returns the current collection. I think it does make sense to offer this, at least with a boolean option as this actually is part of the initial webdav specifications :) <?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
<d:response>
<d:href>/remote.php/dav/trashbin/admin/trash/</d:href>
<d:propstat>
<d:prop>
<d:resourcetype>
<d:collection/>
</d:resourcetype>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/trashbin/admin/trash/1e255300-a6e9-4944-a275-c0cad2e05843.vcf.d1674135367</d:href>
<d:propstat>
<d:prop>
<d:getlastmodified>Thu, 19 Jan 2023 13:36:07 GMT</d:getlastmodified>
<d:getcontentlength>1266</d:getcontentlength>
<d:resourcetype/>
<d:getetag>1674135367</d:getetag>
<d:getcontenttype>text/vcard</d:getcontenttype>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
|
https://www.rfc-editor.org/rfc/rfc4918#section-9.1.4
|
Despite the obvious use I would have for this, from a technical POV changing what the rfc specifications clearly define makes it proplematic I think :) If I assume this library is a node interface to webdav, then reading the webdadv rfc and using the appropriate methods here should also allow me to get a feature parity experience :) While I would myself make it the default for the sake of rfc and consistency, I also completely understand your argument above about fitting people's use cases. |
Thanks for continuing to look into this. What format would you suppose the response be in if one was to specify that they'd want the current collection as well? Just the object structure for the current directory? I'd accept a PR for that, yes. Default Just to reiterate - despite the name of this library it is not this project's goal to achieve feature parity with any WebDAV RFC or spec. That being said I do agree with adding this option. |
Yes, I think I would just keep the response as is, and let your library parse method do its magic :)
I'll keep that in mind! :) |
Hello!
Thanks for your awesome lib :)
I would like to not filter out the current directory while doing a
getDirectoryContents
to avoid an extra request to store the data, is this possible? !webdav-client/source/interface/directoryContents.js
Lines 42 to 47 in 94f7053
Have a great day!
The text was updated successfully, but these errors were encountered: