hpi-schul-cloud / webdav

POC/MVP to have SC files available via WebDav
1 stars 0 forks source link

Bad Request on wrong directory names not thrown properly #16

Closed DevSchmidtchen closed 3 years ago

DevSchmidtchen commented 3 years ago

The directory service on the SC-Server uses Regex to filter some names which are not allowed.

folderRegexCheck(fileName) {
    return [
    /^[a-zA-Z]{1}_drive$/,
    /^Windows$/,
    /^\$.*$/,
    /^\..*$/,
    /^Temporary Items$/,
    /^Network Trash Folder$/,
    /^ *$/,
    ].some((rx) => rx.test(fileName));
}

If the name matches those regular expression, the server throws a BadRequest-Error (400). The WebDAV-Server then throws an Internal Server Error (500) which would be another error like Forbidden (403) or something like this.