-
Notifications
You must be signed in to change notification settings - Fork 638
WebDAV: update to v5 #6780
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
base: master
Are you sure you want to change the base?
WebDAV: update to v5 #6780
Conversation
you are using |
@si458 I checked a few ways of using esm in commonjs and this seems to me the best way so not to have to change too much.
Could also use |
@PTR-inc would u mind please! Sorry to be a pain! I want to try keep everything similar/the same So if they all stay as require, then in the future it be easier to swop it all out :) |
Done. |
db.js
Outdated
if (func) { func('Uploading using WebDAV to: ' + parent.config.settings.autobackup.webdav.url); } | ||
}); | ||
} | ||
const { stat } = await import ('fs/promises'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please can you change this to using fs.statsync
instead?
https://nodejs.org/docs/latest-v16.x/api/fs.html#fsstatsyncpath-options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to using pipeline instead of .pipe. No stat needed anymore. Cleaner, more resillient and futureproof. Tested it on 16.0.0 and latest 16, 22 & 23.
This reverts commit b5635e8.
And reverted the require back to use import, as v16 doesn't allow using require for es modules. |
this ok to merge still? |
@si458 Certainly, if you are ok with the changes/async way. Just did a quick test against the current master and all fine. |
@si458 Is there something keeping this on hold? |
no sorry just working my way through fixing a file transfer bug first then move onto this |
this still good to go? |
Read about an issue somewhere else with trailing slashes and webdav, so checked the webdav rfc's and added a slashcheck for the foldername and moved it to the setup defaults sections. |
The currently used webdav package is v4 using an older axios dependency, giving a security warning in npm audit. The v5 version is an esm package, so converted the upload function accordingly. Now it's up to date again, also dependency-wise.