[bugfix] handle multi ? urls

use `retSegs.push.apply(retSegs, lastSegs);` as that modifies the `retSegs` array. Concat returns a new array and we want to prevent new array creation. This should also fix the test from failing.