Emit a helpful error when 'LocalRequest' is malformed.

This commit is contained in:
Sergio Benitez 2018-08-13 00:44:35 -07:00
parent 4010a967a6
commit 7abfaafcf9
1 changed files with 1 additions and 0 deletions

View File

@ -397,6 +397,7 @@ impl<'c> LocalRequest<'c> {
if let Ok(uri) = Origin::parse(uri) {
request.set_uri(uri.into_owned());
} else {
error!("Malformed request URI: {}", uri);
let res = client.rocket().handle_error(Status::BadRequest, request);
return LocalResponse { _request: owned_request, response: res };
}