Skip to content

Commit

Permalink
Added default fallback to http1.1 when server doesn't support alpn (s…
Browse files Browse the repository at this point in the history
…ee: Jetty)
  • Loading branch information
parthverma1 committed Aug 20, 2024
1 parent a2162a9 commit bef6e93
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/autohttp/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,7 @@ class AutoHttp2Agent extends EventEmitter {
socket.once('secureConnect', () => {
socket.removeListener('error', socketConnectionErrorHandler)

const protocol = socket.alpnProtocol

if (!protocol) {
cb(socket.authorizationError)
socket.end()
return
}
const protocol = socket.alpnProtocol || 'http/1.1'

if (!supportedProtocols.includes(protocol)) {
cb(new Error('Unknown protocol' + protocol))
Expand Down

0 comments on commit bef6e93

Please sign in to comment.