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:
@@ -47,6 +47,9 @@ pub enum UserError {
|
||||
|
||||
/// Illegal headers, such as connection-specific headers.
|
||||
MalformedHeaders,
|
||||
|
||||
/// Request submitted with relative URI.
|
||||
MissingUriSchemeAndAuthority,
|
||||
}
|
||||
|
||||
// ===== impl RecvError =====
|
||||
@@ -125,6 +128,7 @@ impl error::Error for UserError {
|
||||
ReleaseCapacityTooBig => "release capacity too big",
|
||||
OverflowedStreamId => "stream ID overflowed",
|
||||
MalformedHeaders => "malformed headers",
|
||||
MissingUriSchemeAndAuthority => "request URI missing scheme and authority",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user