about summary refs log tree commit diff
path: root/users/Profpatsch/read-http
AgeCommit message (Collapse)AuthorFilesLines
2021-01-31 r/2176 feat(users/Profpatsch): add die_* helpers for semantic exit errorsProfpatsch2-214/+0
There is this semantic exit code schema championed by execline and skaware tooling, and we refined and documented it a bit in lorri https://github.com/nix-community/lorri/blob/d1d673d42090f0cfe8ab9b92b465315a9e7d30a3/src/ops/mod.rs#L24-L35 in the past. This just transcribes the error messages into simple helper functions. Applies the functions to the places where we would panic or die `sys::exit()` instead. Change-Id: I15ca05cd6f99a25a3378518be94110eab416354e Reviewed-on: https://cl.tvl.fyi/c/depot/+/2475 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 r/2174 fix(users/Profpatsch/read-http): actually parse asciiProfpatsch2-3/+5
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 r/2169 refactor(users/Profpatsch/read-http): parse headers as utf8Profpatsch1-9/+11
Headers should always be ASCII, so let’s crash if they are not. The thing gets a lot easier to use, and clients who fail this restriction can just fuck off. Also actually print the results to stdout instead of stderr … Change-Id: I782c96c537ae11b541175e96453c4114e0a71b05 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2451 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-27 r/2150 feat(users/Profpatsch): add read-httpProfpatsch2-0/+210
reads a http request or response from stdin, and parses its headers into a netencoded record. Darn rust code took way too long to write. Change-Id: Ie99faa6d4bbd4996fa4e43fb119a11d85b611c99 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2447 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI