From 3bda5537d7c65311df671c7d2ac7dd72e19720c1 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sat, 19 Aug 2023 18:40:27 +0900 Subject: [PATCH] More verbose unfurler logs --- unfurler/src/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/unfurler/src/index.ts b/unfurler/src/index.ts index 967d60117..2c54a5575 100644 --- a/unfurler/src/index.ts +++ b/unfurler/src/index.ts @@ -258,12 +258,14 @@ class Server { res.status(404).send(); return; } else { + logger.info('proxying resource "' + req.url + '"'); if (this.secureHost) { - https.get(config.SERVER.HOST + ':4200' + rawPath, { headers: { 'user-agent': 'mempoolunfurl' }}, (got) => { + https.get(config.SERVER.HOST + rawPath, { headers: { 'user-agent': 'mempoolunfurl' }}, (got) => { res.writeHead(got.statusCode, got.headers); return got.pipe(res); - }); } else { - http.get(config.SERVER.HOST + ':4200' + rawPath, { headers: { 'user-agent': 'mempoolunfurl' }}, (got) => { + }); + } else { + http.get(config.SERVER.HOST + rawPath, { headers: { 'user-agent': 'mempoolunfurl' }}, (got) => { res.writeHead(got.statusCode, got.headers); return got.pipe(res); }); @@ -272,6 +274,8 @@ class Server { } } + logger.info((unfurl ? 'unfurling ' : 'slurping "') + req.url + '"'); + let result = ''; try { if (unfurl) {