Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds an HTML rewriter feature with an interface mostly the same as Akamai's html-rewriter. Uses the
lol-html
library under the hood.A few potentially questionable design decisions which we may want to go a different way on:
lol-html
's C API into this repo. This was done for a few reasons:rustc
version that we build with, so I patched that change.lol-html
repo and is not published on crates.io.lib.name
in itsCargo.toml
, which is incompatible with StarlingMonkey'sadd_rust_lib
function, so I patched that too.rustc
we compile with (which is a change made in upstream StarlingMonkey already), patchadd_rust_lib
to support customlib.name
s, then grab the C API crate throughcargo
with a simple wrapper library, similar to the existing crates in StarlingMonkey. Alternatively, we could make a fork oflol-html
and point at that instead.insert_implicit_close
feature of Akamai's API, because it seems less important and I don't see a simple way to do this fromlol-html
. I also extended their API with aescapeHTML
option for all insertion functions, which allows inserting HTML content as text.fastly:html-rewriter
. Ideally someone who knows their way around the module system better can tell me what to do here 😄