-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add: remove_http_request_header convenient func #256
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Signed-off-by: nbn01 <[email protected]>
d61c8d3
to
9536299
Compare
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: Could you move it above, so that it's not in-between set_map_value
and set_map_value_bytes
?
Ideally, could you group it with the extern C
prototype, so that it's:
extern "C" {
fn proxy_remove_header_map_value(
[...]
}
pub fn remove_map_value(map_type: MapType, key: &str) -> Result<(), Status> {
[...]
extern "C" {
fn proxy_replace_header_map_value(
[...]
}
pub fn set_map_value(map_type: MapType, key: &str, value: Option<&str>) -> Result<(), Status> {
[...]
to match the existing style in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: The remove
group should be before set
group, since the latter is using proxy_remove_header_map_value
, which is now used before declaration.
@@ -351,6 +351,10 @@ pub trait HttpContext: Context { | |||
hostcalls::add_map_value_bytes(MapType::HttpRequestHeaders, name, value).unwrap() | |||
} | |||
|
|||
fn remove_http_request_header(&self, name: &str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add those for request trailer, response header and response trailer as well? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Friendly ping.
Signed-off-by: Nandan B N <[email protected]>
This is a convenient method to remove request header by key than using set_http_request_header with empty value. Since we already have the things in place, it's just about exposing it for usage with HttpContext.