profile-based whitelist for walkingSpeed

This commit is contained in:
Jannis R 2018-10-30 00:47:40 +01:00
parent 0c145d352b
commit 9a89cd0dc8
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 9 additions and 5 deletions

View file

@ -182,11 +182,14 @@ const createClient = (profile, userAgent, request = _request) => {
if (!['slow','normal','fast'].includes(opt.walkingSpeed)) { if (!['slow','normal','fast'].includes(opt.walkingSpeed)) {
throw new Error('opt.walkingSpeed must be one of these values: "slow", "normal", "fast".') throw new Error('opt.walkingSpeed must be one of these values: "slow", "normal", "fast".')
} }
const gisFltrL = [{ const gisFltrL = []
meta: 'foot_speed_' + opt.walkingSpeed, if (profile.journeysWalkingSpeed) {
mode: 'FB', gisFltrL.push({
type: 'M' meta: 'foot_speed_' + opt.walkingSpeed,
}] mode: 'FB',
type: 'M'
})
}
// With protocol version `1.16`, the VBB endpoint *used to* fail with // With protocol version `1.16`, the VBB endpoint *used to* fail with
// `CGI_READ_FAILED` if you pass `numF`, the parameter for the number // `CGI_READ_FAILED` if you pass `numF`, the parameter for the number

View file

@ -142,6 +142,7 @@ const vbbProfile = {
formatStation, formatStation,
journeysNumF: true, journeysNumF: true,
journeysWalkingSpeed: true,
trip: true, trip: true,
radar: true, radar: true,
reachableFrom: true reachableFrom: true