Update Microsoft restriction and limitations (#725)

* Update Microsoft restriction and limitations about windows naming files to include '~' for folder names
This commit is contained in:
abraunegg 2019-11-14 11:53:07 +11:00 committed by GitHub
parent c876b9c575
commit 0445ae03d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View file

@ -868,7 +868,8 @@ final class OneDriveApi
case 400:
// Bad Request .. how should we act?
log.vlog("OneDrive returned a 'HTTP 400 - Bad Request' - gracefully handling error");
break;
// make sure this is thrown so that it is caught
throw new OneDriveException(http.statusLine.code, http.statusLine.reason, response);
// 403 - Forbidden
case 403:

View file

@ -2419,6 +2419,11 @@ final class SyncEngine
// but when we attempted to create it, OneDrive responded that it now already exists
log.vlog("OneDrive reported that ", path, " already exists .. OneDrive API race condition");
return;
} else {
// some other error from OneDrive was returned - display what it is
log.error("OneDrive generated an error when creating this path: ", path);
displayOneDriveErrorMessage(e.msg);
return;
}
}
// Is the response a valid JSON object - validation checking done in saveItem

View file

@ -190,6 +190,8 @@ bool isValidName(string path)
if (itemName == "desktop.ini") {matched = false;}
// _vti_ cannot appear anywhere in a file or folder name
if(canFind(itemName, "_vti_")){matched = false;}
// Item name cannot equal '~'
if (itemName == "~") {matched = false;}
// return response
return matched;