-
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
robustness #271
base: main
Are you sure you want to change the base?
robustness #271
Conversation
Signed-off-by: pi-pi-miao <[email protected]>
Signed-off-by: pi-pi-miao <[email protected]>
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.
Hi @pi-pi-miao, the CI should be fixed now. Sorry for the delay!
As for your changes, may I ask what motivated them?
You should never see those unknown statuses from the Proxy-Wasm compliant proxies. See: #282.
As for UTF-8 String
failures, those are indeed a problem, but using either _bytes()
variants (which were introduced as a solution to that) or a HeaderValue
type (#287) is a better solution than returning errors and/or ignoring non-UTF-8 values.
I believe all other changes are a viral effect of propagating errors from the 2 issues above, but please correct me if I've missed something.
Thanks!
error!("[get_map_value] Failed to convert to UTF-8 string: {}", e); | ||
Err(Status::SerializationFailure) // Return an appropriate error | ||
} | ||
} |
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.
While this is better than existing behavior, this isn't correct. See #287.
(same for all other instances of failed String::from_utf8()
conversions.
status => { | ||
error!("[log] unexpected status: {}", status as u32); | ||
Err(status) | ||
}, |
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.
This is done by design, since those errors are illegal are not actionable. See #282.
}); | ||
|
||
// 将成功转换的键值对推入 map | ||
map.push((key_string, value_string)); |
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.
Map is serialized by a trusted host environment, so it's not untrusted/malicious input. See: #282.
No description provided.