zeek/auxil/spicy/doc/examples/frontpage.spicy
Patrick Kelley 8fd444092b initial
2025-05-07 15:35:15 -04:00

24 lines
406 B
Plaintext

# http-request.spicy
module HTTP;
const Token = /[^ \t\r\n]+/;
const WhiteSpace = /[ \t]+/;
const NewLine = /\r?\n/;
public type RequestLine = unit {
method: Token;
: WhiteSpace;
uri: Token;
: WhiteSpace;
version: Version;
: NewLine;
on %done { print self; }
};
type Version = unit {
: /HTTP\//;
number: /[0-9]+\.[0-9]+/;
};