From 695e6e6b79c4ed9616d3ff75a18674780918f2e7 Mon Sep 17 00:00:00 2001 From: James Harris Date: Mon, 11 Jul 2022 09:15:19 +1000 Subject: [PATCH] Bump version to v0.3.3. --- CHANGELOG.md | 7 +++++++ cmd/echo-server/main.go | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b692a74..0a29bc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ The format is based on [Keep a Changelog], and this project adheres to [keep a changelog]: https://keepachangelog.com/en/1.0.0/ [semantic versioning]: https://semver.org/spec/v2.0.0.html +## [0.3.3] - 2022-07-11 + +### Fixed + +- Prevent rendering empty header value along real header values +- Render all values for each header, not only the first + ## [0.3.2] - 2022-07-08 ### Changed diff --git a/cmd/echo-server/main.go b/cmd/echo-server/main.go index 7b8bfb0..2da1516 100644 --- a/cmd/echo-server/main.go +++ b/cmd/echo-server/main.go @@ -267,7 +267,7 @@ func writeRequest(w io.Writer, req *http.Request) { } func printHeaders(w io.Writer, h http.Header) { - sortedKeys := make([]string, len(h)) + sortedKeys := make([]string, 0, len(h)) for key := range h { sortedKeys = append(sortedKeys, key) @@ -276,6 +276,8 @@ func printHeaders(w io.Writer, h http.Header) { sort.Strings(sortedKeys) for _, key := range sortedKeys { - fmt.Fprintf(w, "%s: %s\n", key, h.Get(key)) + for _, value := range h[key] { + fmt.Fprintf(w, "%s: %s\n", key, value) + } } }