http: minor fixes.
This commit is contained in:
parent
86746e2bd0
commit
aeb3d8f352
@ -59,6 +59,7 @@ function LowlevelUp(backend, location, options) {
|
|||||||
|
|
||||||
LowlevelUp.prototype.init = function init() {
|
LowlevelUp.prototype.init = function init() {
|
||||||
const Backend = this.backend;
|
const Backend = this.backend;
|
||||||
|
|
||||||
let db = new Backend(this.location);
|
let db = new Backend(this.location);
|
||||||
let binding = db;
|
let binding = db;
|
||||||
|
|
||||||
|
|||||||
@ -366,6 +366,7 @@ HTTPBase.prototype.readBody = function readBody(req, enc, options) {
|
|||||||
|
|
||||||
HTTPBase.prototype._readBody = function _readBody(req, enc, options, resolve, reject) {
|
HTTPBase.prototype._readBody = function _readBody(req, enc, options, resolve, reject) {
|
||||||
const decode = new StringDecoder(enc);
|
const decode = new StringDecoder(enc);
|
||||||
|
|
||||||
let hasData = false;
|
let hasData = false;
|
||||||
let total = 0;
|
let total = 0;
|
||||||
let body = '';
|
let body = '';
|
||||||
@ -1256,6 +1257,7 @@ Request.prototype.init = function init(req, res, url) {
|
|||||||
|
|
||||||
Request.prototype.parse = function parse(url) {
|
Request.prototype.parse = function parse(url) {
|
||||||
const uri = URL.parse(url);
|
const uri = URL.parse(url);
|
||||||
|
|
||||||
let pathname = uri.pathname;
|
let pathname = uri.pathname;
|
||||||
let query = Object.create(null);
|
let query = Object.create(null);
|
||||||
let trailing = false;
|
let trailing = false;
|
||||||
|
|||||||
@ -380,7 +380,7 @@ HTTPServer.prototype.initRouter = function initRouter() {
|
|||||||
this.post('/:id/send', async (req, res) => {
|
this.post('/:id/send', async (req, res) => {
|
||||||
const valid = req.valid();
|
const valid = req.valid();
|
||||||
const passphrase = valid.str('passphrase');
|
const passphrase = valid.str('passphrase');
|
||||||
const outputs = valid.array('outputs');
|
const outputs = valid.array('outputs', []);
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
rate: valid.u64('rate'),
|
rate: valid.u64('rate'),
|
||||||
@ -397,6 +397,7 @@ HTTPServer.prototype.initRouter = function initRouter() {
|
|||||||
for (const output of outputs) {
|
for (const output of outputs) {
|
||||||
const valid = new Validator([output]);
|
const valid = new Validator([output]);
|
||||||
const raw = valid.buf('script');
|
const raw = valid.buf('script');
|
||||||
|
|
||||||
let script = null;
|
let script = null;
|
||||||
|
|
||||||
if (raw)
|
if (raw)
|
||||||
@ -420,7 +421,7 @@ HTTPServer.prototype.initRouter = function initRouter() {
|
|||||||
this.post('/:id/create', async (req, res) => {
|
this.post('/:id/create', async (req, res) => {
|
||||||
const valid = req.valid();
|
const valid = req.valid();
|
||||||
const passphrase = valid.str('passphrase');
|
const passphrase = valid.str('passphrase');
|
||||||
const outputs = valid.array('outputs');
|
const outputs = valid.array('outputs', []);
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
rate: valid.u64('rate'),
|
rate: valid.u64('rate'),
|
||||||
@ -436,6 +437,7 @@ HTTPServer.prototype.initRouter = function initRouter() {
|
|||||||
for (const output of outputs) {
|
for (const output of outputs) {
|
||||||
const valid = new Validator([output]);
|
const valid = new Validator([output]);
|
||||||
const raw = valid.buf('script');
|
const raw = valid.buf('script');
|
||||||
|
|
||||||
let script = null;
|
let script = null;
|
||||||
|
|
||||||
if (raw)
|
if (raw)
|
||||||
@ -870,7 +872,7 @@ HTTPServer.prototype.handleSocket = function handleSocket(socket) {
|
|||||||
|
|
||||||
socket.auth = true;
|
socket.auth = true;
|
||||||
|
|
||||||
this.logger.info('Successful auth from %s.', socket.host);
|
this.logger.info('Successful auth from %s.', socket.remoteAddress);
|
||||||
|
|
||||||
this.handleAuth(socket);
|
this.handleAuth(socket);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user