Always using webdav

This commit is contained in:
Henrique Dias
2016-10-18 16:42:48 +01:00
parent 59f5109617
commit 3683c4c06a
5 changed files with 46 additions and 42 deletions

View File

@@ -431,7 +431,9 @@ var newDirEvent = function(event) {
let button = document.getElementById('new');
let html = button.changeToLoading();
let request = new XMLHttpRequest();
request.open("MKCOL", toWebDavURL(window.location.pathname + document.getElementById('newdir').value + "/"));
let name = document.getElementById('newdir').value;
request.open((name.endsWith("/") ? "MKCOL" : "PUT"), toWebDavURL(window.location.pathname + name));
request.setRequestHeader('Token', token);
request.send();
request.onreadystatechange = function() {