diff --git a/config.js b/config.js index 762aea94..44b42927 100644 --- a/config.js +++ b/config.js @@ -31,7 +31,6 @@ const config = { 'track_type', 'country', ], - snapPreventions: ['ferry'], }, // Use 'profiles' to define which profiles are visible and how. Useful if the /info endpoint contains too many or too "ugly" profile diff --git a/src/api/Api.ts b/src/api/Api.ts index c5c85097..9f4959b5 100644 --- a/src/api/Api.ts +++ b/src/api/Api.ts @@ -283,11 +283,12 @@ export class ApiImpl implements Api { locale: getTranslation().getLang(), points_encoded: true, points_encoded_multiplier: 1e6, - snap_preventions: config.request?.snapPreventions ? config.request.snapPreventions : [], ...profileConfig, details: details, } + if (config.request?.snapPreventions) request.snap_preventions = config.request?.snapPreventions + if (args.customModel) { request.custom_model = args.customModel request['ch.disable'] = true diff --git a/test/routing/Api.test.ts b/test/routing/Api.test.ts index 5f2304ba..a0ccb6b5 100644 --- a/test/routing/Api.test.ts +++ b/test/routing/Api.test.ts @@ -112,7 +112,6 @@ describe('route', () => { locale: 'en_US', points_encoded: true, points_encoded_multiplier: 1e6, - snap_preventions: ['ferry'], details: [ 'road_class', 'road_environment', @@ -155,7 +154,6 @@ describe('route', () => { locale: 'en_US', points_encoded: true, points_encoded_multiplier: 1e6, - snap_preventions: ['ferry'], details: [ 'road_class', 'road_environment', @@ -207,7 +205,6 @@ describe('route', () => { locale: 'en_US', points_encoded: true, points_encoded_multiplier: 1e6, - snap_preventions: ['ferry'], details: [ 'road_class', 'road_environment', @@ -315,7 +312,6 @@ describe('route', () => { locale: 'de_DE', points_encoded: true, points_encoded_multiplier: 1e6, - snap_preventions: ['ferry'], details: [ 'road_class', 'road_environment',