mirror of https://github.com/rwf2/Rocket.git
Add 'tls_enabled' method to Config.
This commit is contained in:
parent
162bf19c72
commit
070529e1ac
|
@ -651,6 +651,17 @@ impl Config {
|
|||
self.extras.iter().map(|(k, v)| (k.as_str(), v))
|
||||
}
|
||||
|
||||
/// Returns `true` if TLS is enabled.
|
||||
///
|
||||
/// Always returns `false` if the `tls` compilation feature is not enabled.
|
||||
pub fn tls_enabled(&self) -> bool {
|
||||
if cfg!(feature = "tls") {
|
||||
self.tls.is_some()
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
/// Retrieves the secret key from `self`.
|
||||
#[inline]
|
||||
pub(crate) fn secret_key(&self) -> &Key {
|
||||
|
|
Loading…
Reference in New Issue