RawPostData should give default value

This commit is contained in:
斟酌 鵬兄 2016-09-08 11:23:57 +08:00
parent c75b49d935
commit 7b8348be37

View File

@ -57,7 +57,7 @@ class HttpRequest extends EventEmitter
{
this.Method = "POST";
this.Headers[ "Content-Type" ] = "application/x-www-form-urlencoded";
this.RawPostData = new Buffer( Data );
this.RawPostData = Data == undefined ? new Buffer([]) : new Buffer( Data );
this.Headers[ "Content-Length" ] = this.RawPostData.length;
}