Skip to content

Commit

Permalink
fix: re-add http resolver listen
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Ranna committed May 24, 2019
1 parent 32db4ea commit af2bdae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Xud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class Xud extends EventEmitter {

if (!this.swapClientManager.raidenClient.isDisabled()) {
this.httpServer = new HttpServer(loggers.http, this.service);
await this.httpServer.listen(this.config.http.port);
}

// start rpc server last
Expand Down
2 changes: 2 additions & 0 deletions lib/http/HttpServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ class HttpServer {
private requestListener: http.RequestListener = async (req, res) => {
if (!req.headers['content-length']) {
res.writeHead(411);
res.end();
return;
}

let reqJson: any;
try {
reqJson = await reqToJson(req);
this.logger.debug(`http server request json: ${JSON.stringify(reqJson)}`);
} catch (err) {
res.writeHead(400);
res.end(err);
Expand Down

0 comments on commit af2bdae

Please sign in to comment.