Commit Graph

4 Commits

Author SHA1 Message Date
Bruno Oliveira 38ef6b73f5 feat: add support for the HTTP QUERY method (RFC 10008)
QUERY (RFC 10008, June 2026; registered in the IANA HTTP Method Registry) is
safe and idempotent like GET but carries a request body like POST. It is wired
through exactly like PATCH:

- actix-web: `guard::Query()`, `web::query()`, `Resource::query()`, and
  `TestRequest::query()`
- actix-web-codegen: `#[query]` routing macro (plus re-export from actix-web)

`http` 0.2 has no `Method::QUERY` constant, so the method is built with
`Method::from_bytes(b"QUERY").unwrap()`, with a TODO to switch to the constant
once the `http` dependency is bumped (#3384). No dependency changes.
`actix-http` needs no change (it uses `http::Method` directly).

Tests mirror the existing PATCH coverage and add a body-carrying QUERY test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 19:05:40 -03:00
Rob Ede 34327bd221
chore: address clippy warnings 2024-12-29 15:03:43 +00:00
Rob Ede e0e4d1e661
chore: move deny lints to manifests 2024-07-07 03:54:00 +01:00
Jonathan Lim 3db7891303
Scope macro (#3136)
* add scope proc macro

* Update scope macro code to work with current HttpServiceFactory

* started some test code

* add some unit tests

* code formatting cleanup

* add another test for combining and calling 2 scopes

* format code with formatter

* Update actix-web-codegen/src/lib.rs with comment documentation fix

Co-authored-by: oliver <151407407+kwfn@users.noreply.github.com>

* work in progress. revised procedural macro to change othe macro call

* add tests again. refactor nested code.

* clean up code. fix bugs with route and method attributes with parameters

* clean up for rust fmt

* clean up for rust fmt

* fix out of date comment for scope macro

* sync to master branch by adding test_wrap

* needed to format code

* test: split out scope tests

* test: add negative tests

* chore: move imports back inside (?)

* docs: tweak scope docs

* fix: prevent trailing slashes in scope prefixes

* chore: address clippy lints

---------

Co-authored-by: oliver <151407407+kwfn@users.noreply.github.com>
Co-authored-by: Rob Ede <robjtede@icloud.com>
2024-06-07 22:10:48 +00:00