How can I extract the HTTP version of an incoming request using express?
I need something like:
app.use('/', (req, res, next) => {
req.getHttpVersion() // 'HTTP 1.0'/'HTTP 1.1'/'HTTP 2.0'
});
How can I extract the HTTP version of an incoming request using express?
I need something like:
app.use('/', (req, res, next) => {
req.getHttpVersion() // 'HTTP 1.0'/'HTTP 1.1'/'HTTP 2.0'
});
Try this:
app.use('/', (req, res, next) => {
console.log('Request HTTP Version: ', req.httpVersion)
});
I know tis is old , but still.. you can try :
app.use('/', (req, res, next) => {
console.log('AlpnProtocol: ' , req.connection.alpnProtocol,)
});
© 2022 - 2024 — McMap. All rights reserved.