Client should validate request URI. (#181)
This patch adds checks for the request URI and rejects invalid URIs. In the case of forwarding an HTTP 1.1 request with a path, an "http" pseudo header is added to satisfy the HTTP/2.0 spec. Closes #179
This commit is contained in:
@@ -8,9 +8,6 @@ use std::fmt;
|
||||
|
||||
/// Either a Client or a Server
|
||||
pub trait Peer {
|
||||
/// Message type sent into the transport
|
||||
type Send;
|
||||
|
||||
/// Message type polled from the transport
|
||||
type Poll: fmt::Debug;
|
||||
|
||||
@@ -18,8 +15,6 @@ pub trait Peer {
|
||||
|
||||
fn is_server() -> bool;
|
||||
|
||||
fn convert_send_message(id: StreamId, headers: Self::Send, end_of_stream: bool) -> Headers;
|
||||
|
||||
fn convert_poll_message(headers: Headers) -> Result<Self::Poll, RecvError>;
|
||||
|
||||
fn is_local_init(id: StreamId) -> bool {
|
||||
|
||||
@@ -74,8 +74,6 @@ impl Send {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
let end_stream = frame.is_end_stream();
|
||||
|
||||
// Update the state
|
||||
|
||||
@@ -494,7 +494,8 @@ where
|
||||
}
|
||||
|
||||
// Convert the message
|
||||
let headers = client::Peer::convert_send_message(stream_id, request, end_of_stream);
|
||||
let headers = client::Peer::convert_send_message(
|
||||
stream_id, request, end_of_stream)?;
|
||||
|
||||
let mut stream = me.store.insert(stream.id, stream);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user