script: Implement parsing of Link HTTP headers (#39052)

The Link HTTP header can do the same as link elements,
in that they can preload/prefetch/etc... This implements
the basics of header parsing and hooks it up for preload.

Note that we use a new nom-rfc8288 crate that implements
the parsing behavior. However, that crate is too strict
in that empty attributes (;; as part of the header) are
discarded and resulting in a parsing failure. Therefore,
we use its lenient parsing mode.

Part of #35035

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Tim van der Lippe 2025-09-28 09:22:09 +02:00 committed by GitHub
parent 41b1a8706b
commit ba5f36b671
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 716 additions and 675 deletions

View file

@ -93,6 +93,7 @@ mime = { workspace = true }
mime_guess = { workspace = true }
net_traits = { workspace = true }
nom = { workspace = true }
nom-rfc8288 = { workspace = true }
num-traits = { workspace = true }
num_cpus = { workspace = true }
parking_lot = { workspace = true }