Skip to content

Commit b81e3a8

Browse files
authored
Fix error condition in v2 proxy support (#1161)
1 parent 0af7705 commit b81e3a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exporter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ func registerCollector(logger *slog.Logger, transport *http.Transport,
281281

282282
// as we do not use any TLVs, header size should be pretty small, hence we only check for error, assuming the whole header went out in a single packet
283283
_, err = header.WriteTo(conn)
284-
if err == nil {
284+
if err != nil {
285285
conn.Close()
286286
return nil, fmt.Errorf("writing proxyproto header via %s to %s: %w", network, addr, err)
287287
}

0 commit comments

Comments
 (0)