-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: check for empty header value and allow
- Loading branch information
Showing
2 changed files
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,9 +218,10 @@ func TestMilterClient_UsualFlow(t *testing.T) { | |
hdr := textproto.Header{} | ||
hdr.Add("From", "[email protected]") | ||
hdr.Add("To", "[email protected]") | ||
hdr.Add("x-empty-header", "") | ||
act, err = session.Header(hdr) | ||
assertAction(act, err, ActContinue) | ||
if len(mm.Hdr) != 2 { | ||
if len(mm.Hdr) != 3 { | ||
t.Fatal("Unexpected header length:", len(mm.Hdr)) | ||
} | ||
if val := mm.Hdr.Get("From"); val != "[email protected]" { | ||
|
@@ -229,6 +230,9 @@ func TestMilterClient_UsualFlow(t *testing.T) { | |
if val := mm.Hdr.Get("To"); val != "[email protected]" { | ||
t.Fatal("Wrong To header:", val) | ||
} | ||
if val := mm.Hdr.Get("x-empty-header"); val != "" { | ||
t.Fatal("Wrong To header:", val) | ||
} | ||
|
||
modifyActs, act, err := session.BodyReadFrom(bytes.NewReader(bytes.Repeat([]byte{'A'}, 128000))) | ||
assertAction(act, err, ActContinue) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters