Skip to content

Commit bd0076f

Browse files
committed
cache_http2_hpack: Improve usefulnes of field value check
1 parent d0fe497 commit bd0076f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bin/varnishd/http2/cache_http2_hpack.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,17 @@ h2h_checkhdr(struct vsl_log *vsl, txt nm, txt val)
106106
case FLD_VALUE_FIRST:
107107
if (vct_issp(*p)) {
108108
VSLb(vsl, SLT_BogoHeader,
109-
"Illegal field value start %.*s", l, nm.b);
109+
"Illegal field value 0x%02x start %.*s",
110+
*p, l, nm.b);
110111
return (H2SE_PROTOCOL_ERROR);
111112
}
112113
state = FLD_VALUE;
113114
/* FALLTHROUGH */
114115
case FLD_VALUE:
115116
if (!vct_ishdrval(*p)) {
116117
VSLb(vsl, SLT_BogoHeader,
117-
"Illegal field value %.*s", l, nm.b);
118+
"Illegal field value 0x%02x %.*s",
119+
*p, l, nm.b);
118120
return (H2SE_PROTOCOL_ERROR);
119121
}
120122
break;
@@ -124,7 +126,8 @@ h2h_checkhdr(struct vsl_log *vsl, txt nm, txt val)
124126
}
125127
if (state == FLD_VALUE && vct_issp(val.e[-1])) {
126128
VSLb(vsl, SLT_BogoHeader,
127-
"Illegal field value (end) %.*s", l, nm.b);
129+
"Illegal field value 0x%02x (end) at %.*s",
130+
val.e[-1], l, nm.b);
128131
return (H2SE_PROTOCOL_ERROR);
129132
}
130133
return (0);

0 commit comments

Comments
 (0)