Skip to content

Commit

Permalink
Merge pull request #98 from Kuadrant/fix-header-resolver
Browse files Browse the repository at this point in the history
Create HeaderResolver once
  • Loading branch information
adam-cattermole authored Oct 7, 2024
2 parents 08f7d1f + bbe4382 commit 3632d2d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/filter/root_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ pub struct FilterRoot {
impl RootContext for FilterRoot {
fn on_vm_start(&mut self, _vm_configuration_size: usize) -> bool {
let full_version: &'static str = formatcp!(
"v{} ({}) {} {}",
WASM_SHIM_VERSION,
WASM_SHIM_GIT_HASH,
WASM_SHIM_FEATURES,
WASM_SHIM_PROFILE,
"v{WASM_SHIM_VERSION} ({WASM_SHIM_GIT_HASH}) {WASM_SHIM_FEATURES} {WASM_SHIM_PROFILE}"
);

info!(
Expand All @@ -40,6 +36,7 @@ impl RootContext for FilterRoot {
fn create_http_context(&self, context_id: u32) -> Option<Box<dyn HttpContext>> {
debug!("#{} create_http_context", context_id);
let mut service_handlers: HashMap<String, Rc<GrpcServiceHandler>> = HashMap::new();
let header_resolver = Rc::new(HeaderResolver::new());
self.config
.services
.iter()
Expand All @@ -48,7 +45,7 @@ impl RootContext for FilterRoot {
.entry(extension.clone())
.or_insert(Rc::from(GrpcServiceHandler::new(
Rc::clone(service),
Rc::new(HeaderResolver::new()),
Rc::clone(&header_resolver),
)));
});
Some(Box::new(Filter {
Expand Down

0 comments on commit 3632d2d

Please sign in to comment.