Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

robustness #271

wants to merge 2 commits into from

Conversation

pi-pi-miao
Copy link

No description provided.

Signed-off-by: pi-pi-miao <[email protected]>
Copy link
Member

@PiotrSikora PiotrSikora left a 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
}
}
Copy link
Member

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.

Comment on lines +29 to +32
status => {
error!("[log] unexpected status: {}", status as u32);
Err(status)
},
Copy link
Member

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));
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants