From 7fe1399c9e7f7721ca6b63a46ec3c413f4241197 Mon Sep 17 00:00:00 2001 From: Santosh Cheler Date: Mon, 23 Jan 2023 11:36:34 -0800 Subject: [PATCH 1/3] Match Accept header with Content-Type in the proto exporter --- .../src/platform/browser/OTLPProtoExporterBrowserBase.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts b/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts index 1b386855e4..eabb8ac469 100644 --- a/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts +++ b/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts @@ -75,7 +75,7 @@ export abstract class OTLPProtoExporterBrowserBase< sendWithXhr( new Blob([body], { type: 'application/x-protobuf' }), this.url, - { ...this._headers, 'Content-Type': 'application/x-protobuf' }, + { ...this._headers, 'Content-Type': 'application/x-protobuf', 'Accept': 'application/x-protobuf' }, this.timeoutMillis, onSuccess, onError From 6059720de32226b5f624a2b0b9e7bdde51b525db Mon Sep 17 00:00:00 2001 From: Santosh Cheler Date: Mon, 23 Jan 2023 11:55:11 -0800 Subject: [PATCH 2/3] Lint fixes --- .../src/platform/browser/OTLPProtoExporterBrowserBase.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts b/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts index eabb8ac469..4e9f95d5c0 100644 --- a/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts +++ b/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts @@ -75,7 +75,11 @@ export abstract class OTLPProtoExporterBrowserBase< sendWithXhr( new Blob([body], { type: 'application/x-protobuf' }), this.url, - { ...this._headers, 'Content-Type': 'application/x-protobuf', 'Accept': 'application/x-protobuf' }, + { + ...this._headers, + 'Content-Type': 'application/x-protobuf', + Accept: 'application/x-protobuf', + }, this.timeoutMillis, onSuccess, onError From 5521fd2f86b6e1910bb823c9ea8842f69263834d Mon Sep 17 00:00:00 2001 From: Santosh Cheler Date: Mon, 23 Jan 2023 12:09:31 -0800 Subject: [PATCH 3/3] Add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index daa351e51d..651c54da10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ### :bug: (Bug Fix) +* fix(otlp-proto-exporter-base): Match Accept header with Content-Type in the proto exporter + [#3562](https://github.com/open-telemetry/opentelemetry-js/pull/3562) @scheler + ### :books: (Refine Doc) ### :house: (Internal)