From 9a89cd0dc889f9befaac0b22df3c26fd3ec5b511 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Tue, 30 Oct 2018 00:47:40 +0100 Subject: [PATCH] profile-based whitelist for walkingSpeed --- index.js | 13 ++++++++----- p/vbb/index.js | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index bf033778..8aaacc77 100644 --- a/index.js +++ b/index.js @@ -182,11 +182,14 @@ const createClient = (profile, userAgent, request = _request) => { if (!['slow','normal','fast'].includes(opt.walkingSpeed)) { throw new Error('opt.walkingSpeed must be one of these values: "slow", "normal", "fast".') } - const gisFltrL = [{ - meta: 'foot_speed_' + opt.walkingSpeed, - mode: 'FB', - type: 'M' - }] + const gisFltrL = [] + if (profile.journeysWalkingSpeed) { + gisFltrL.push({ + meta: 'foot_speed_' + opt.walkingSpeed, + mode: 'FB', + type: 'M' + }) + } // With protocol version `1.16`, the VBB endpoint *used to* fail with // `CGI_READ_FAILED` if you pass `numF`, the parameter for the number diff --git a/p/vbb/index.js b/p/vbb/index.js index 973b3c59..b7b98fcd 100644 --- a/p/vbb/index.js +++ b/p/vbb/index.js @@ -142,6 +142,7 @@ const vbbProfile = { formatStation, journeysNumF: true, + journeysWalkingSpeed: true, trip: true, radar: true, reachableFrom: true