[#1938] Return 400 on bad URI
Merge pull request #3469 from xuwei-k/backport-1938

backport #1938 for 2.2.x