Skip to content

Commit fe68066

Browse files
committed
Remove the code for nullifying err. Update unit test: return none if both invalid and valid headers exist
1 parent 6889ded commit fe68066

File tree

3 files changed

+0
-9
lines changed

3 files changed

+0
-9
lines changed

exporters/otlp/otlplog/otlploggrpc/config_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ func TestNewConfig(t *testing.T) {
8181

8282
headers := map[string]string{"a": "A"}
8383
percentDecodedHeaders := map[string]string{"user%2Did": "42", "user%20name": "alice smith"}
84-
validHeaders := map[string]string{"valid-key": "value"}
8584
rc := retry.Config{}
8685

8786
dialOptions := []grpc.DialOption{grpc.WithUserAgent("test-agent")}
@@ -475,7 +474,6 @@ func TestNewConfig(t *testing.T) {
475474
endpoint: newSetting("env.endpoint:8080"),
476475
insecure: newSetting(false),
477476
tlsCfg: newSetting(tlsCfg),
478-
headers: newSetting(validHeaders),
479477
compression: newSetting(GzipCompression),
480478
timeout: newSetting(15 * time.Second),
481479
retryCfg: newSetting(defaultRetryCfg),

exporters/otlp/otlplog/otlploghttp/config.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,6 @@ func convHeaders(s string) (map[string]string, error) {
563563

564564
out[key] = val
565565
}
566-
// If at least one valid header exists, reset err to nil
567-
if len(out) > 0 {
568-
global.Warn("Some headers were invalid but at least one valid header exists: %v", err)
569-
err = nil
570-
}
571566
return out, err
572567
}
573568

exporters/otlp/otlplog/otlploghttp/config_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ func TestNewConfig(t *testing.T) {
8181

8282
headers := map[string]string{"a": "A"}
8383
percentDecodedHeaders := map[string]string{"user%2Did": "42", "user%20name": "alice smith"}
84-
validHeaders := map[string]string{"valid-key": "value"}
8584
rc := retry.Config{}
8685

8786
testcases := []struct {
@@ -407,7 +406,6 @@ func TestNewConfig(t *testing.T) {
407406
path: newSetting("/prefix"),
408407
insecure: newSetting(false),
409408
tlsCfg: newSetting(tlsCfg),
410-
headers: newSetting(validHeaders),
411409
compression: newSetting(GzipCompression),
412410
timeout: newSetting(15 * time.Second),
413411
retryCfg: newSetting(defaultRetryCfg),

0 commit comments

Comments
 (0)