Skip to content

Commit a3f3ab1

Browse files
committed
Fix url escaping
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent c0552fe commit a3f3ab1

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/services/FileInfo.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
*/
2222

2323
import client from './DavClient'
24-
import { genFileInfo } from '../utils/fileUtils'
24+
import { genFileInfo, encodeFilePath } from '../utils/fileUtils'
25+
2526
/**
2627
* Retrieve the files list
2728
*
@@ -30,7 +31,7 @@ import { genFileInfo } from '../utils/fileUtils'
3031
* @returns {Array} the file list
3132
*/
3233
export default async function(path, options) {
33-
const response = await client.stat(path, Object.assign({
34+
const response = await client.stat(encodeFilePath(path), Object.assign({
3435
data: `<?xml version="1.0"?>
3536
<d:propfind xmlns:d="DAV:"
3637
xmlns:oc="http://owncloud.org/ns"

src/services/FileList.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222

2323
import client from './DavClient'
24-
import { genFileInfo } from '../utils/fileUtils'
24+
import { genFileInfo, encodeFilePath } from '../utils/fileUtils'
2525

2626
/**
2727
* Retrieve the files list
@@ -34,7 +34,7 @@ export default async function(path, options) {
3434
// getDirectoryContents doesn't accept / for root
3535
const fixedPath = path === '/' ? '' : path
3636

37-
const response = await client.getDirectoryContents(fixedPath, Object.assign({
37+
const response = await client.getDirectoryContents(encodeFilePath(fixedPath), Object.assign({
3838
data: `<?xml version="1.0"?>
3939
<d:propfind xmlns:d="DAV:"
4040
xmlns:oc="http://owncloud.org/ns"

0 commit comments

Comments
 (0)