Fix obligatory content on sendFile (#292)

This commit is contained in:
Bruno Moreira
2016-04-23 17:32:15 +01:00
committed by abalabahaha
parent 68a21ee679
commit a5517c2c3b
2 changed files with 5 additions and 9 deletions

View File

@@ -791,7 +791,7 @@ var InternalClient = (function () {
// def sendFile // def sendFile
InternalClient.prototype.sendFile = function sendFile(where, _file, name, _content) { InternalClient.prototype.sendFile = function sendFile(where, _file, name, content) {
var _this18 = this; var _this18 = this;
if (!name) { if (!name) {
@@ -805,11 +805,9 @@ var InternalClient = (function () {
} }
} }
var content = this.resolver.resolveString(_content);
if (content) { if (content) {
content = { content = {
content: content content: this.resolver.resolveString(content)
}; };
} }

View File

@@ -648,7 +648,7 @@ export default class InternalClient {
} }
// def sendFile // def sendFile
sendFile(where, _file, name, _content) { sendFile(where, _file, name, content) {
if (!name) { if (!name) {
if (_file instanceof String || typeof _file === "string") { if (_file instanceof String || typeof _file === "string") {
name = require("path").basename(_file); name = require("path").basename(_file);
@@ -660,11 +660,9 @@ export default class InternalClient {
} }
} }
var content = this.resolver.resolveString(_content); if (content) {
if(content) {
content = { content = {
content content: this.resolver.resolveString(content)
}; };
} }