From 6061be8990084209b02a6c68f16eb15c0686792b Mon Sep 17 00:00:00 2001 From: prembhaskal Date: Tue, 4 Mar 2025 23:06:02 +0530 Subject: [PATCH] fix to return empty value for empty header The method get_http_request_headers_bytes return empty vec for empty header value but get_http_request_header_bytes returns None for empty header value. Also added same fix in get_map_value for get_http_request_header method. This commit intends to fix this inconsistency. Signed-off-by: prembhaskal --- src/hostcalls.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hostcalls.rs b/src/hostcalls.rs index 8dbc335..3b29f27 100644 --- a/src/hostcalls.rs +++ b/src/hostcalls.rs @@ -241,7 +241,7 @@ pub fn get_map_value(map_type: MapType, key: &str) -> Result, Sta .unwrap(), )) } else { - Ok(None) + Ok(Some(String::new())) } } Status::NotFound => Ok(None), @@ -269,7 +269,7 @@ pub fn get_map_value_bytes(map_type: MapType, key: &str) -> Result return_size, ))) } else { - Ok(None) + Ok(Some(Vec::new())) } } Status::NotFound => Ok(None),