Skip to content

Commit

Permalink
Encode path to NFC (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
feiniks authored Feb 15, 2022
1 parent 0f17808 commit d8b64ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ See [Seafile Server Manual](http://manual.seafile.com/extension/webdav.html) for

# Running

There are two templates for running seafdav:
There are a template for running seafdav:
- run.sh.template: This is for running seafdav on the default 8080 port with a built-in CherryPy server.
- run-fcgi.sh.template and seafdav.conf.template:
These two files are for running seafdav on fastcgi mode.

To run on 8080 port:

Expand All @@ -24,10 +22,10 @@ Then change CCNET_CONF_DIR and SEAFILE_CONF_DIR to your Seafile server's setting
- start local seafile server
- start local seahub server (While seafdav itself doesn't require seahub, we use seahub webapi as a driver for testing)
- start seafdav server
- create a test user `test@seafiltest.com` with password `test`
- create a test user `test@seafiletest.com` with password `test`
- Run the tests
```
export CCNET_CONF_DIR=/path/to/ccnet
export SEAFILE_CONF_DIR=/path/to/seafile-data
./functest.sh test
./ci/functest.sh test
```
3 changes: 3 additions & 0 deletions wsgidav/seafile_dav_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import time
import posixpath
import unicodedata

import tempfile

Expand Down Expand Up @@ -738,6 +739,7 @@ def get_resource_inst(self, path, environ):
return SeafileResource(path, repo, rel_path, obj, environ, self.block_map, self.block_map_lock)

def resolvePath(path, username, org_id, is_guest):
path = unicodedata.normalize('NFC', path)
segments = path.strip("/").split("/")
if len(segments) == 0:
raise DAVError(HTTP_BAD_REQUEST)
Expand Down Expand Up @@ -767,6 +769,7 @@ def resolvePath(path, username, org_id, is_guest):
return (repo, rel_path, obj)

def resolveRepoPath(repo, path):
path = unicodedata.normalize('NFC', path)
segments = path.strip("/").split("/")

obj = get_repo_root_seafdir(repo)
Expand Down

0 comments on commit d8b64ae

Please sign in to comment.