Validate source/destination indices correctly in nodejs support (#5595)

* validate source/destination indices correctly

Co-authored-by: Denis Chapligin <denis.chaplygin@wolt.com>
Co-authored-by: Daniel Patterson <danpat@danpat.net>
This commit is contained in:
Karen Shea
2021-01-28 15:02:01 +01:00
committed by GitHub
parent 960269f95a
commit a613375460
4 changed files with 22 additions and 8 deletions
+7
View File
@@ -108,6 +108,13 @@ BOOST_AUTO_TEST_CASE(invalid_table_urls)
BOOST_CHECK_EQUAL(
testInvalidOptions<TableParameters>("1,2;3,4?annotations=durations&fallback_speed=-1"),
28UL);
// TODO(danpat): this is only testing invalid grammar which isn't capable of checking
// for values that need to reference other things currently. These
// requests are gramatically correct, but semantically incorrect.
// The table service properly fails these, as it checks IsValid() after
// parsing, which fails when sources/destinations are too large
// BOOST_CHECK_EQUAL(testInvalidOptions<TableParameters>("1,2;3,4?sources=2"), 7UL);
// BOOST_CHECK_EQUAL(testInvalidOptions<TableParameters>("1,2;3,4?destinations=2"), 7UL);
}
BOOST_AUTO_TEST_CASE(valid_route_hint)