Backport request URI fixes to Jetty 8

0035343af33c3626e0d29bb3338e8e1256cabb50 & 810ff3802fafb0e3546fa6f11db45e0dfcfcc61b