Allow isolated context to read protected params (#4533)

This commit is contained in:
Micha de Vries 2024-08-19 13:09:35 +02:00 committed by GitHub
parent 9657dd80c7
commit c7c0249d34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,4 @@
use crate::cnf::PROTECTED_PARAM_NAMES;
use crate::ctx::canceller::Canceller;
use crate::ctx::reason::Reason;
#[cfg(feature = "http")]
@ -371,7 +372,7 @@ impl MutableContext {
pub fn value(&self, key: &str) -> Option<&Value> {
match self.values.get(key) {
Some(v) => Some(v.as_ref()),
None if !self.isolated => match &self.parent {
None if PROTECTED_PARAM_NAMES.contains(&key) || !self.isolated => match &self.parent {
Some(p) => p.value(key),
_ => None,
},