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

Support URL-encoded values for OTEL_EXPORTER_OTLP_HEADERS #1578

Merged
merged 12 commits into from
Mar 1, 2024
Prev Previous commit
Next Next commit
Merge branch 'main' into url-encode-headers
pyohannes authored Feb 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 52080cfd90a98503387c4f182286ab7a9284c6aa
6 changes: 6 additions & 0 deletions opentelemetry-otlp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,12 @@

- URL encoded values in `OTEL_EXPORTER_OTLP_HEADERS` are now correctly decoded. [#1578](https://github.com/open-telemetry/opentelemetry-rust/pull/1578)

### Added

- Added `DeltaTemporalitySelector` ([#1568])

[#1568]: https://github.com/open-telemetry/opentelemetry-rust/pull/1568

## v0.15.0

### Changed

Unchanged files with check annotations Beta

}
if !chars_to_decode.is_empty() {
result.push_str(&std::str::from_utf8(&chars_to_decode).ok()?);

Check failure on line 230 in opentelemetry-otlp/src/exporter/mod.rs

GitHub Actions / lint

this expression creates a reference which is immediately dereferenced by the compiler

Check failure on line 230 in opentelemetry-otlp/src/exporter/mod.rs

GitHub Actions / lint

this expression creates a reference which is immediately dereferenced by the compiler
chars_to_decode.clear();
}
pub fn with_headers(mut self, headers: HashMap<String, String>) -> Self {
// headers will be wrapped, so we must do some logic to unwrap first.
let mut inst_headers = self.http_config.headers.unwrap_or_default();
inst_headers.extend(
headers
.into_iter()
.map(|(key, value)| (key, super::url_decode(&value).unwrap_or(value))),
);

Check warning on line 127 in opentelemetry-otlp/src/exporter/http/mod.rs

Codecov / codecov/patch

opentelemetry-otlp/src/exporter/http/mod.rs#L123-L127

Added lines #L123 - L127 were not covered by tests
self.http_config.headers = Some(inst_headers);
self
}
You are viewing a condensed version of this merge commit. You can view the full changes here.