Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

改移动文件返回信息为对象,添加srever选项时不启动自带http服务。 #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions lib/DAV/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jsDAV_Handler.STATUS_MAP = {
// RFC5397
"{DAV:}current-user-principal"
];

/**
* This property allows you to automatically add the 'resourcetype' value
* based on a node's classname or interface.
Expand Down Expand Up @@ -332,7 +332,7 @@ jsDAV_Handler.STATUS_MAP = {
cbgetnodefp(null, node);
});
};

/**
* This method is called with every tree update
*
Expand Down Expand Up @@ -856,7 +856,7 @@ jsDAV_Handler.STATUS_MAP = {
this.httpPut = function() {
var self = this;
var uri = this.getRequestUri();

// Intercepting Content-Range
if (this.httpRequest.headers["content-range"]) {
/*
Expand Down Expand Up @@ -1089,7 +1089,7 @@ jsDAV_Handler.STATUS_MAP = {
self.httpResponse.writeHead(moveInfo.destinationExists ? 204 : 201,
{"content-length": "0"});
self.httpResponse.end();
self.dispatchEvent("afterMove", moveInfo.destination);
self.dispatchEvent("afterMove", {source: moveInfo.source,destination: moveInfo.destination});
});
});
});
Expand Down Expand Up @@ -1242,7 +1242,7 @@ jsDAV_Handler.STATUS_MAP = {
var ctype;
var self = this;
var req = this.httpRequest;
var isStream = forceStream === true
var isStream = forceStream === true
? true
: (!(ctype = req.headers["content-type"]) || !ctype.match(/(urlencoded|multipart)/i));

Expand Down Expand Up @@ -1437,7 +1437,7 @@ jsDAV_Handler.STATUS_MAP = {
for (var i = 0, l = ifMatch.length; i < l; ++i) {
// Stripping any extra spaces
ifMatchItem = Util.trim(ifMatch[i], " ");

if (etag === ifMatchItem) {
haveMatch = true;
break;
Expand Down Expand Up @@ -1762,8 +1762,8 @@ jsDAV_Handler.STATUS_MAP = {
"{DAV:}getcontenttype"
];
}


// If the resourceType was not part of the list, we manually add it
// and mark it for removal. We need to know the resourcetype in order
// to make certain decisions about the entry.
Expand Down Expand Up @@ -1822,7 +1822,7 @@ jsDAV_Handler.STATUS_MAP = {
"403" : {},
"404" : {}
};

var myProperties = [].concat(propertyNames);

var propertyMap = Util.arrayToMap(myProperties);
Expand Down Expand Up @@ -2427,7 +2427,7 @@ jsDAV_Handler.STATUS_MAP = {
});
});
}

function onDone() {
self.markDirty(parentUri);
self.dispatchEvent("afterBind", uri, Path.join(parent.path, newName));
Expand Down
1 change: 1 addition & 0 deletions lib/DAV/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ function Server(options) {
}
});
}
return options.server;
}
else {
this.setBaseUri(this.guessBaseUri());
Expand Down