fix #1037 to use route information instead

fix https://github.com/projectkudu/kudu/issues/1037.  it is more like engineering improvement to reduce/avoid paths manipulation.