mirror of
https://github.com/Cameri/nostream.git
synced 2025-08-03 19:22:12 +02:00
fix: send correct content-type headers
This commit is contained in:
@@ -54,7 +54,7 @@ export class WebServerAdapter extends EventEmitter implements IWebServerAdapter
|
|||||||
const body = JSON.stringify(relayInformationDocument)
|
const body = JSON.stringify(relayInformationDocument)
|
||||||
response.end(body)
|
response.end(body)
|
||||||
} else if (request.headers['upgrade'] !== 'connection') {
|
} else if (request.headers['upgrade'] !== 'connection') {
|
||||||
response.setHeader('content-type', 'application/text')
|
response.setHeader('content-type', 'text/plain')
|
||||||
response.end('Please use a Nostr client to connect.')
|
response.end('Please use a Nostr client to connect.')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ export class WebServerAdapter extends EventEmitter implements IWebServerAdapter
|
|||||||
if (error['code'] === 'ECONNRESET' || !socket.writable) {
|
if (error['code'] === 'ECONNRESET' || !socket.writable) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
socket.end('HTTP/1.1 400 Bad Request\r\n\r\n')
|
socket.end('HTTP/1.1 400 Bad Request\r\nContent-Type: text/html\r\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
protected onClose() {
|
protected onClose() {
|
||||||
|
Reference in New Issue
Block a user