-import type { IncomingMessage, RequestListener, ServerResponse } from 'node:http'
+import type { IncomingMessage, ServerResponse } from 'node:http'
import { StatusCodes } from 'http-status-codes'
}
public start (): void {
- this.httpServer.on('request', this.requestListener.bind(this) as RequestListener)
+ this.httpServer.on('request', this.requestListener.bind(this))
this.startHttpServer()
}
}
private requestListener (req: IncomingMessage, res: ServerResponse): void {
- this.authenticate(req, (err) => {
+ this.authenticate(req, err => {
if (err != null) {
res
.writeHead(StatusCodes.UNAUTHORIZED, {
throw new BaseError(`Unsupported UI protocol version: '${fullProtocol}'`)
}
this.registerProtocolVersionUIService(version)
- req.on('error', (error) => {
+ req.on('error', error => {
logger.error(
`${this.logPrefix(moduleName, 'requestListener.req.onerror')} Error on HTTP request:`,
error