Skip to content

Commit

Permalink
fix(server): Request.ssl() works
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed May 24, 2016
1 parent 1b6d1c6 commit ce0b62e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/server/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ impl<'a, 'b: 'a> Request<'a, 'b> {
/// Get a reference to the underlying Ssl stream, if connected
/// over HTTPS.
///
/// This is actually just an alias for `downcast_ref`.
///
/// # Example
///
/// ```rust
Expand All @@ -95,11 +97,7 @@ impl<'a, 'b: 'a> Request<'a, 'b> {
/// ```
#[inline]
pub fn ssl<T: NetworkStream>(&self) -> Option<&T> {
use ::net::HttpsStream;
match self.downcast_ref() {
Some(&HttpsStream::Https(ref s)) => Some(s),
_ => None
}
self.downcast_ref()
}

/// Deconstruct a Request into its constituent parts.
Expand Down

0 comments on commit ce0b62e

Please sign in to comment.