use std::cell::RefCell;
thread_local! {
static STAGED: RefCell<Option<String>> = const { RefCell::new(None) };
static PAGE_CSRF: RefCell<String> = const { RefCell::new(String::new()) };
}
pub fn stage_response_cache_control(value: impl Into<String>) {
STAGED.with(|cell| *cell.borrow_mut() = Some(value.into()));
}
pub fn take_response_cache_control() -> Option<String> {
STAGED.with(|cell| cell.borrow_mut().take())
}
pub fn stage_page_csrf(token: impl Into<String>) {
PAGE_CSRF.with(|cell| *cell.borrow_mut() = token.into());
}
pub fn page_csrf() -> String {
PAGE_CSRF.with(|cell| cell.borrow().clone())
}