vpn.email.server.gfw
Advanced tools
Comparing version 0.1.176 to 0.1.177
{ | ||
"name": "vpn.email.server.gfw", | ||
"version": "0.1.176", | ||
"version": "0.1.177", | ||
"description": "Vpn.Email over firewall mode", | ||
@@ -5,0 +5,0 @@ "main": "server.js", |
@@ -110,3 +110,3 @@ /*! | ||
} | ||
get Body() { | ||
get PostBody() { | ||
const length = parseInt(this.headers['content-length']); | ||
@@ -113,0 +113,0 @@ if (!length) |
@@ -140,3 +140,3 @@ /*! | ||
get Body () { | ||
get PostBody () { | ||
const length = parseInt ( this.headers[ 'content-length' ]) | ||
@@ -143,0 +143,0 @@ if ( !length ) |
@@ -54,5 +54,20 @@ /*! | ||
} | ||
const ret = Buffer.from(httpHeader.Url.path.substr(1), 'base64'); | ||
if (httpHeader.isGet) { | ||
const ret = Buffer.from(httpHeader.Url.path.substr(1), 'base64'); | ||
this.last = this.temp; | ||
this.temp = Buffer.allocUnsafe(0); | ||
return cb(null, ret); | ||
} | ||
if (httpHeader._parts.length < 3) { | ||
return cb(); | ||
} | ||
const ret = Buffer.from(httpHeader.PostBody, 'base64'); | ||
if (!ret) { | ||
console.log('*************************************'); | ||
console.log(this.last.toString('utf8')); | ||
console.log(httpHeader.buffer.toString('utf8')); | ||
console.log('*************************************'); | ||
return cb(new Error('httpHeader')); | ||
} | ||
this.last = this.temp; | ||
this.temp = Buffer.allocUnsafe(0); | ||
return cb(null, ret); | ||
@@ -59,0 +74,0 @@ } |
@@ -63,11 +63,26 @@ /*! | ||
if ( httpHeader.isGet ) { | ||
const ret = Buffer.from ( httpHeader.Url.path.substr (1), 'base64' ) | ||
this.last = this.temp | ||
this.temp = Buffer.allocUnsafe ( 0 ) | ||
return cb ( null, ret ) | ||
} | ||
const ret = Buffer.from ( httpHeader.Url.path.substr (1), 'base64' ) | ||
if ( httpHeader._parts.length < 3 ) { | ||
return cb () | ||
} | ||
const ret = Buffer.from ( httpHeader.PostBody, 'base64' ) | ||
if ( !ret ) { | ||
console.log ('*************************************') | ||
console.log ( this.last.toString ('utf8')) | ||
console.log ( httpHeader.buffer.toString ('utf8')) | ||
console.log ('*************************************') | ||
return cb ( new Error ('httpHeader')) | ||
} | ||
this.last = this.temp | ||
this.temp = Buffer.allocUnsafe ( 0 ) | ||
return cb ( null, ret ) | ||
} | ||
} |
844800
12300