Panic with npm:fetch-http2
when using headers with Uppercase characters
#24678
Labels
npm:fetch-http2
when using headers with Uppercase characters
#24678
Version: Deno 1.45.2
So, I got a panic when I tried to use http2 fetch like so:
However such a code results in a panic:
The error message refers to this line:
deno/ext/node/ops/http2.rs
Line 320 in 92abdb7
Which uses
from_lowercase
from http crate:https://github.com/hyperium/http/blob/f4e8c0c3159b18b8b7e4a6a3762c55528483d25a/src/header/name.rs#L1166-L1193
As seen from the function's code InvalidHeaderName can only occur if any of the characters is 0 according to HEADER_CHARS_H2 array:
https://github.com/hyperium/http/blob/f4e8c0c3159b18b8b7e4a6a3762c55528483d25a/src/header/name.rs#L1040-L1068
One might also notice that this array ain't got uppercase characters. That lead me to try a fully lowercase header:
And this works fine (it doesn't panic). I think the issue here is that deno uses a function intended for lowercase strings without ensuring that the string is indeed lowercase.
The text was updated successfully, but these errors were encountered: