Skip to content

Commit

Permalink
Delegate response writing to the standard writing method in arg (Meth…
Browse files Browse the repository at this point in the history
…odCallArgs)
  • Loading branch information
AdrienCastex committed May 16, 2017
1 parent 952f217 commit 24836fc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions lib/server/commands/Propfind.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,8 @@ function default_1(arg, callback) {
});
}
function done(multistatus) {
var content = XML_1.XML.toXML(multistatus);
arg.setCode(WebDAVRequest_1.HTTPCodes.MultiStatus);
arg.response.setHeader('Content-Type', 'text/xml; charset="utf-8"');
arg.response.setHeader('Content-Length', content.length.toString());
arg.response.write(content);
arg.writeXML(multistatus);
callback();
}
});
Expand Down
2 changes: 1 addition & 1 deletion lib/server/commands/Proppatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function default_1(arg, callback) {
var finalize = function () {
finalize = function () {
arg.setCode(WebDAVRequest_1.HTTPCodes.MultiStatus);
arg.response.write(XML_1.XML.toXML(multistatus));
arg.writeXML(multistatus);
callback();
};
};
Expand Down
5 changes: 1 addition & 4 deletions src/server/commands/Propfind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,8 @@ export default function(arg : MethodCallArgs, callback)

function done(multistatus)
{
const content = XML.toXML(multistatus);
arg.setCode(HTTPCodes.MultiStatus);
arg.response.setHeader('Content-Type', 'text/xml; charset="utf-8"')
arg.response.setHeader('Content-Length', content.length.toString())
arg.response.write(content);
arg.writeXML(multistatus);
callback();
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/server/commands/Proppatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function(arg : MethodCallArgs, callback)
finalize = function()
{
arg.setCode(HTTPCodes.MultiStatus);
arg.response.write(XML.toXML(multistatus));
arg.writeXML(multistatus);
callback();
}
}
Expand Down

0 comments on commit 24836fc

Please sign in to comment.