Skip to content

Commit db30130

Browse files
peffgitster
authored andcommitted
http: handle both "h2" and "h2h3" in curl info lines
When redacting auth tokens in trace output from curl, we look for http/2 headers of the form "h2h3 [header: value]". This comes from b637a41 (http: redact curl h2h3 headers in info, 2022-11-11). But the "h2h3" prefix changed to just "h2" in curl's fc2f1e547 (http2: support HTTP/2 to forward proxies, non-tunneling, 2023-04-14). That's in released version curl 8.1.0; linking against that version means we'll fail to correctly redact the trace. Our t5559.17 notices and fails. We can fix this by matching either prefix, which should handle both old and new versions. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b637a41 commit db30130

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

http.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,8 @@ static void redact_sensitive_info_header(struct strbuf *header)
630630
* h2h3 [<header-name>: <header-val>]
631631
*/
632632
if (trace_curl_redact &&
633-
skip_iprefix(header->buf, "h2h3 [", &sensitive_header)) {
633+
(skip_iprefix(header->buf, "h2h3 [", &sensitive_header) ||
634+
skip_iprefix(header->buf, "h2 [", &sensitive_header))) {
634635
if (redact_sensitive_header(header, sensitive_header - header->buf)) {
635636
/* redaction ate our closing bracket */
636637
strbuf_addch(header, ']');

0 commit comments

Comments
 (0)