More verbose unfurler logs

This commit is contained in:
Mononaut 2023-08-19 18:40:27 +09:00
parent df8b6cd53c
commit 3bda5537d7
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E

View File

@ -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) {