Skip to content

Commit 6061be8

Browse files
committed
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 <[email protected]>
1 parent c8b2335 commit 6061be8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hostcalls.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pub fn get_map_value(map_type: MapType, key: &str) -> Result<Option<String>, Sta
241241
.unwrap(),
242242
))
243243
} else {
244-
Ok(None)
244+
Ok(Some(String::new()))
245245
}
246246
}
247247
Status::NotFound => Ok(None),
@@ -269,7 +269,7 @@ pub fn get_map_value_bytes(map_type: MapType, key: &str) -> Result<Option<Bytes>
269269
return_size,
270270
)))
271271
} else {
272-
Ok(None)
272+
Ok(Some(Vec::new()))
273273
}
274274
}
275275
Status::NotFound => Ok(None),

0 commit comments

Comments
 (0)