tvl-depot/users/Profpatsch/read-http/default.nix
Profpatsch f0579313d3 fix(users/Profpatsch/read-http): actually parse ascii
There might be exploits since we parsed the headers as utf8 even
though we actually want to interpret them as ASCII.

This fixes it, by using the ascii crate.

Thanks to @sterni for noticing.

Change-Id: I50b6a588d99b34e677cb22968cf0dfd8b331d11c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2457
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-31 11:10:00 +00:00

20 lines
503 B
Nix

{ depot, pkgs, ... }:
let
# reads a http request (stdin), and writes all headers to stdout, as netencoded dict
read-http = depot.users.Profpatsch.writers.rustSimple {
name = "read-http";
dependencies = [
depot.users.Profpatsch.rust-crates.ascii
depot.users.Profpatsch.rust-crates.httparse
depot.users.Profpatsch.netencode.netencode-rs
depot.users.Profpatsch.arglib.netencode.rust
];
} (builtins.readFile ./read-http.rs);
in {
inherit
read-http
;
}