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

Enhance error reporting for invalid header value #1892

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Swap the non-RustCrypto `md5` crate for the RustCrypto `md-5` crate, to match
usage of RustCrypto `sha2` crate
- Remove `Sync` constraint on `ByteStream`-related functions.
- Enhance error reporting for invalid header value

## [0.46.0] - 2021-01-05

- Display `rusoto_core::Client` in docs
Expand Down
7 changes: 4 additions & 3 deletions rusoto/core/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,10 @@ where
let header_value = match HeaderValue::from_bytes(v) {
Ok(value) => value,
Err(err) => {
return Err(HttpDispatchError {
message: format!("error parsing header value: {}", err),
});
return Err(HttpDispatchError::new(format!(
"Value of header {:?} contains invalid header byte. Error: {}",
h.0, err
)));
}
};
hyper_headers.append(&header_name, header_value);
Expand Down