MCPcopy Create free account
hub / github.com/git/git / match_curl_h2_trace

Function match_curl_h2_trace

http.c:890–918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

888}
889
890static int match_curl_h2_trace(const char *line, const char **out)
891{
892 const char *p;
893
894 /*
895 * curl prior to 8.1.0 gives us:
896 *
897 * h2h3 [<header-name>: <header-val>]
898 *
899 * Starting in 8.1.0, the first token became just "h2".
900 */
901 if (skip_iprefix(line, "h2h3 [", out) ||
902 skip_iprefix(line, "h2 [", out))
903 return 1;
904
905 /*
906 * curl 8.3.0 uses:
907 * [HTTP/2] [<stream-id>] [<header-name>: <header-val>]
908 * where <stream-id> is numeric.
909 */
910 if (skip_iprefix(line, "[HTTP/2] [", &p)) {
911 while (isdigit(*p))
912 p++;
913 if (skip_prefix(p, "] [", out))
914 return 1;
915 }
916
917 return 0;
918}
919
920/* Redact headers in info */
921static void redact_sensitive_info_header(struct strbuf *header)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected