summaryrefslogtreecommitdiffstats
path: root/client.js
diff options
context:
space:
mode:
authormauve <ranger@mauve.moe>2020-08-18 15:43:08 -0400
committerJannis Redmann <mail@jannisr.de>2020-08-19 16:34:35 +0200
commit93626a3d88b3a5da464e27e0045ac49dcb378c36 (patch)
treebc35a529cd69d304db453f1e66577f0f1ebde4a2 /client.js
parent72abf040ac48253399787a60244318c0500b4770 (diff)
Adjust APN ID logic
Diffstat (limited to 'client.js')
-rw-r--r--client.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/client.js b/client.js
index 4b8bd8d..387f8b1 100644
--- a/client.js
+++ b/client.js
@@ -19,7 +19,7 @@ const _request = (pathOrUrl, opt, cb) => {
const {
verifyAlpnId,
} = {
- verifyAlpnId: alpnId => alpnId === ALPN_ID,
+ verifyAlpnId: alpnId => alpnId ? (alpnId === ALPN_ID) : true,
...opt,
}
@@ -163,9 +163,10 @@ const sendGeminiRequest = (pathOrUrl, opt, done) => {
hostname: target.hostname || 'localhost',
port: target.port || DEFAULT_PORT,
tlsOpt,
- verifyAlpnId,
}
+ if (verifyAlpnId) reqOpt.verifyAlpnId = verifyAlpnId
+
let cb = (err, res) => {
if (err) return done(err)