There are cases where environment values coming in may contain non-CGI escaped
invalid UTF-8 characters. We have experienced this with requests coming in from
Windows Internet Explorer 11 with query strings that contain smart quotes
("\x93\x94") with our Rails server. This would invariably cause stack traces
further down the Rack stack because we had invalid strings.
The fix here removes invalid UTF-8 characters before passing it to
cleaned_uri_string.
There are cases where environment values coming in may contain non-CGI escaped invalid UTF-8 characters. We have experienced this with requests coming in from Windows Internet Explorer 11 with query strings that contain smart quotes ("\x93\x94") with our Rails server. This would invariably cause stack traces further down the Rack stack because we had invalid strings.
The fix here removes invalid UTF-8 characters before passing it to
cleaned_uri_string
.