[#1938] Return 400 on bad URI

see #1938