Skip to content

Add header filtering support#19

Open
Sytten wants to merge 1 commit intomainfrom
ef-header
Open

Add header filtering support#19
Sytten wants to merge 1 commit intomainfrom
ef-header

Conversation

@Sytten
Copy link
Member

@Sytten Sytten commented Mar 6, 2026

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds HTTPQL request header filtering so queries can match on header name/value, including a shorthand bracket form that expands to an AND between header-name equality and header-value filtering.

Changes:

  • Extend Rust + JS grammars/parsers to support req.header.name|value.<stringExpr> and req.header["<Name>"].<stringExpr>.
  • Add request header primitives + serialization support in both Rust and JS implementations.
  • Add AST golden tests for the explicit and shorthand header syntaxes.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/httpql/ast/20/input.httpql New golden input covering explicit req.header.name + req.header.value filtering.
tests/httpql/ast/20/output.ast Expected canonical AST string for explicit header filtering.
tests/httpql/ast/21/input.httpql New golden input covering shorthand req.header["..."] syntax.
tests/httpql/ast/21/output.ast Expected canonical AST string for shorthand syntax (expanded to AND).
rust/httpql/src/primitives.rs Adds request header clause primitive and display formatting (`req.header.name
rust/httpql/src/parser.rs Parses header filtering, including shorthand expansion into an and Query.
rust/httpql/src/lib.rs Adds Rust golden test cases 20 and 21.
rust/httpql/httpql.pest Extends Pest grammar with header field/subfields and bracket syntax.
js/httpql/src/primitives.ts Adds ClauseRequestHeader to the JS AST types.
js/httpql/src/serialize.ts Serializes request header name/value filters.
js/httpql/src/deserialize/clause.ts Adjusts request clause deserialization to return a full Query (needed for shorthand AND expansion).
js/httpql/src/deserialize/clause.request.ts Implements header long-form and shorthand parsing (shorthand expands to AND).
js/httpql/httpql.grammar Extends Lezer grammar with header field/subfields and bracket syntax.
js/httpql/src/parser/parser.ts Regenerated Lezer parser output to reflect grammar changes.
js/httpql/src/parser/parser.terms.ts Regenerated term IDs/names to include new header/bracket tokens.
js/httpql/src/index.spec.ts Adds JS golden test cases 20 and 21.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants