Skip to content

Commit

Permalink
chore: update webdav to 5.2.2
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Jul 5, 2023
1 parent 28c2d9e commit 18f88a7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
11 changes: 8 additions & 3 deletions apps/files/src/services/WebdavClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import { createClient, getPatcher, RequestOptions } from 'webdav'
import { request } from '../../../../node_modules/webdav/dist/node/request.js'
import type { RequestOptions, Response } from 'webdav'

import { createClient, getPatcher } from 'webdav'
import { generateRemoteUrl } from '@nextcloud/router'
import { getCurrentUser, getRequestToken } from '@nextcloud/auth'
import { request } from 'webdav/dist/node/request.js'

export const rootPath = `/files/${getCurrentUser()?.uid}`
export const defaultRootUrl = generateRemoteUrl('dav' + rootPath)
Expand All @@ -40,7 +42,10 @@ export const getClient = (rootUrl = defaultRootUrl) => {
* @see https://github.com/perry-mitchell/webdav-client/blob/8d9694613c978ce7404e26a401c39a41f125f87f/source/request.ts
*/
const patcher = getPatcher()
patcher.patch('request', (options: RequestOptions) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// https://github.com/perry-mitchell/hot-patcher/issues/6
patcher.patch('request', (options: RequestOptions): Promise<Response> => {
if (options.headers?.method) {
options.method = options.headers.method
delete options.headers.method
Expand Down
1 change: 1 addition & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const ignorePatterns = [
'@nextcloud/vue',
'ansi-regex',
'char-regex',
'is-svg',
'splitpanes',
'string-length',
'strip-ansi',
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
"vuex-router-sync": "^5.0.0",
"webdav": "^5.2.1"
"webdav": "^5.2.2"
},
"devDependencies": {
"@babel/node": "^7.20.7",
Expand Down

0 comments on commit 18f88a7

Please sign in to comment.