zeek/doc/devel/spicy/examples/my-http.spicy
Tim Wojtulewicz 0e46cc7a98 Run pre-commit on the imported docs files
This includes a minor change to the docs .typos.toml file to not change the
string 'tpe' to 'type'.
2025-09-26 02:59:07 +00:00

26 lines
505 B
Text

# @TEST-EXEC: echo "GET /index.html HTTP/1.0" | spicy-driver %INPUT >output
# @TEST-EXEC: btest-diff output
module MyHTTP;
const Token = /[^ \t\r\n]+/;
const WhiteSpace = /[ \t]+/;
const NewLine = /\r?\n/;
type Version = unit {
: /HTTP\//;
number: /[0-9]+\.[0-9]+/;
};
public type RequestLine = unit {
method: Token;
: WhiteSpace;
uri: Token;
: WhiteSpace;
version: Version;
: NewLine;
on %done {
print self.method, self.uri, self.version.number;
}
};