We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc4a0f7 commit 8b8daa3Copy full SHA for 8b8daa3
server.js
@@ -249,9 +249,10 @@ class Server extends EventEmitter {
249
}
250
251
if (req.url === '/stats.json' || req.headers.accept === 'application/json') {
252
- res.write(JSON.stringify(stats))
253
- res.end()
+ res.setHeader('Content-Type', 'application/json')
+ res.end(JSON.stringify(stats))
254
} else if (req.url === '/stats') {
255
+ res.setHeader('Content-Type', 'text/html');
256
res.end(`
257
<h1>${stats.torrents} torrents (${stats.activeTorrents} active)</h1>
258
<h2>Connected Peers: ${stats.peersAll}</h2>
0 commit comments