David Pedersen
6cd356690d
Annotate panicking functions with #[track_caller] ( #1248 )
2022-08-11 12:45:42 +02:00
David Pedersen and Jonas Platte
50a4be999d
Update matchit and fix nesting inconsistencies ( #1086 )
...
* Break `Router::nest` into `nest` and `nest_service` methods
* fix doc tests
* update docs
* fix
* Only accept `Router` in `Resource::{nest, nest_collection}`
* update changelog
* fix docs
* fix `MatchedPath` with `Router`s nested with `nest_service`
* Apply suggestions from code review
Co-authored-by: Jonas Platte <[email protected] >
* adjust docs for fallbacks
* Always nest services as opaque
* fix old docs reference
* more tests for `MatchedPath` with nested handlers
* minor clean up
* use identifier captures in format strings
* Apply suggestions from code review
Co-authored-by: Jonas Platte <[email protected] >
* fix test
Co-authored-by: Jonas Platte <[email protected] >
2022-08-11 10:17:08 +00:00
David Pedersen
0090d007c0
Fix benchmark filtering
2022-08-11 11:12:04 +02:00
David Pedersen
9e50bf16fb
Add initial benchmarks ( #1243 )
...
* Add initial benchmarks
* improve error message if rewrk isn't installed
* what env vars does github ci have?
* run benchmarks for a bit on ci
* debug error
* ignore args on ci
* actually also locally
* apply review suggestions
2022-08-11 08:52:23 +00:00
David Pedersen
c72ee6eca9
Document browsers ignoring SSE events without data fields ( #1242 )
...
* Document browsers ignoring SSE events without data fields
* only add note on `Event::data`
2022-08-10 10:40:31 +00:00
David Pedersen
9b44654c86
Add "Ordering" link to middleware table of contents ( #1241 )
...
Seems I forgot to add it.
2022-08-10 12:34:05 +02:00
David Pedersen
e79820dbc4
Support chaining handlers with one.or(two).or(three) ( #1170 )
...
* WIP: Handler fallbacks
* Docs
* box futures a bit less
* changelog
2022-08-10 10:09:08 +00:00
David Pedersen and Jonas Platte
d9ef24c5ff
Replace async-graphql with link to async-graphql's own examples ( #1234 )
...
* Replace async-graphql with link to async-graphql's own examples
* exclude async-graphql directory
* does this fix it?
* apparently this needs to be sorted as well
* Update .github/workflows/CI.yml
Co-authored-by: Jonas Platte <[email protected] >
Co-authored-by: Jonas Platte <[email protected] >
2022-08-09 14:56:50 +00:00
David Pedersen
3bcc8fb07d
fix typo in CI.yml
2022-07-26 14:03:35 +02:00
David Pedersen
10ab8c7aba
Add missing cfg to axum_extra::extract::Form ( #1194 )
2022-07-26 00:25:45 +02:00
David Pedersen
234c8ccb13
Improve build times by generating less IR ( #1192 )
...
* example
* `MethodRouter::merge`
* `set_content_length` and `set_allow_header`
* `MethodRouter::on_service_boxed_response_body`
* `Router::route`
* `MethodRouter::merge` again
* `MethodRouter::on_service_boxed_response_body`
* `Router::call_route`
* `MethodRouter::{layer, route_layer}`
* revert example
* fix test
* move function to method on `AllowHeader`
2022-07-25 18:06:37 +00:00
David Pedersen
b243e171fd
Accept S::Response: IntoResponse everywhere ( #1165 )
2022-07-19 18:55:15 +02:00
David Pedersen
329bd5f9b4
Support any middleware response that implements IntoResponse ( #1152 )
...
* Support any middleware response that implements `IntoResponse`
* Require `Infallible` for middleware added with `Handler::layer`
2022-07-13 08:38:19 +00:00
David Pedersen
92dbbd3182
Return rejection if WebSocket request couldn't be upgraded ( #1135 )
...
* Return rejection if `WebSocket` request couldn't be upgraded
* make rejection about connection upgrades
* changelog links
2022-07-11 14:33:55 +02:00
David Pedersen
8c9998eab7
Don't derive debug impl for Resource ( #1153 )
...
We don't actually require `B` to be `Debug` but the derived impl does.
2022-07-11 09:41:41 +02:00
David Pedersen
bed0b83421
Add http-server as crates.io subcategory
2022-07-10 14:28:11 +02:00
David Pedersen
605980b21c
Add introduction to axum talk to ECOSYSTEM.md
2022-07-07 22:48:30 +02:00
David Pedersen
2966407dc1
Re-export debug_handler from axum ( #1144 )
...
* Re-export `debug_handler` from axum
Fixes #1143
* also axum-extra
2022-07-04 09:10:52 +00:00
David Pedersen
2e80ebd18d
Support running extractors from middleware::from_fn
2022-07-03 16:49:20 +02:00
David Pedersen
f8c8f5b697
Add note about breaking changes to readme
2022-07-02 11:46:53 +02:00
David Pedersen
eff3b716d3
Document running extractors from middleware ( #1140 )
...
Fixes #1134
2022-07-02 09:44:17 +00:00
David Pedersen
698b5ccf39
Update trybuilds for rust 1.62
2022-07-01 10:24:15 +02:00
David Pedersen and Jonas Platte
a4c820420d
Remove trailing slash redirects ( #1119 )
...
* Prepare axum-next branch
* Remove deprecated `extractor_middleware` function (#1077 )
* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` (#948 )
* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` (#924 )
* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}`
Fixes https://github.com/tokio-rs/axum/issues/922
* changelog
* fixup changelog
* Panic on overlapping routes in `MethodRouter` (#1102 )
* Panic on overlapping routes in `MethodRouter`
* changelog link
* add test to ensure `head` and `get` don't overlap
* Fix changelog
* Prepare axum-next branch
* Remove trailing slash redirects
* changelog link
* Fix changelog
* remove asserting to make make the test more clear
* remove tsr related feature
* Add `RouterExt::route_with_tsr`
* Apply suggestions from code review
Co-authored-by: Jonas Platte <[email protected] >
* Update axum-extra/src/routing/mod.rs
Co-authored-by: Jonas Platte <[email protected] >
* fix typos in docs
* Update axum/CHANGELOG.md
Co-authored-by: Jonas Platte <[email protected] >
* mention `RouterExt::route_with_tsr` in the changelog
Co-authored-by: Jonas Platte <[email protected] >
2022-06-30 00:22:43 +02:00
David Pedersen
23808f72a2
Fix changelog
2022-06-28 22:07:10 +02:00
David Pedersen
2b386c0baa
Panic on overlapping routes in MethodRouter ( #1102 )
...
* Panic on overlapping routes in `MethodRouter`
* changelog link
* add test to ensure `head` and `get` don't overlap
2022-06-28 22:07:10 +02:00
David Pedersen
661473dcbc
Allow Error: Into<Infallible> for Route::{layer, route_layer} ( #948 )
...
* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` (#924 )
* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}`
Fixes https://github.com/tokio-rs/axum/issues/922
* changelog
* fixup changelog
2022-06-28 22:07:10 +02:00
David Pedersen
56ddabcd7d
Remove deprecated extractor_middleware function ( #1077 )
2022-06-28 22:07:10 +02:00
David Pedersen
7e794e9d1d
axum: Version 0.5.10 ( #1128 )
2022-06-28 21:32:39 +02:00
David Pedersen and Jonas Platte
a8d0ce8c03
Fix possible panic when doing trailing slash redirect ( #1124 )
...
* Fix possible panic when doing trailing slash redirect
Fixes https://github.com/tokio-rs/axum/issues/1122
* changelog link
* Update axum/src/routing/mod.rs
Co-authored-by: Jonas Platte <[email protected] >
Co-authored-by: Jonas Platte <[email protected] >
2022-06-28 16:58:13 +02:00
David Pedersen
905bbfb8e2
axum-extra: Version 0.3.5 ( #1125 )
2022-06-27 21:08:12 +02:00
David Pedersen
b10c9d34bd
axum-macros: Version 0.2.3 ( #1126 )
2022-06-27 21:06:59 +02:00
David Pedersen
11179b8033
Silence "unnecessary use of to_string" lint for #[derive(TypedPath)] ( #1117 )
...
* Fix "unnecessary use of `to_string`" lint for `#[derive(TypedPath)]`
* changelog
* Update axum-macros/CHANGELOG.md
2022-06-27 18:57:02 +00:00
David Pedersen
f6b1d35c51
Use minimal dependency versions for MSRV tests on CI ( #1109 )
2022-06-27 20:44:20 +02:00
David Pedersen and Jonas Platte
cb207472f4
Make Router faster to clone ( #1123 )
...
* Make `Router` faster to clone
* changelog
* Update axum/src/routing/mod.rs
Co-authored-by: Jonas Platte <[email protected] >
* fix
* Update axum/src/routing/mod.rs
Co-authored-by: Jonas Platte <[email protected] >
Co-authored-by: Jonas Platte <[email protected] >
2022-06-27 11:00:19 +02:00
David Pedersen
523c7fed88
Depend on right version of tokio-stream
2022-06-25 12:26:37 +02:00
David Pedersen
6b6a415622
Add JsonLines extractor and response ( #1093 )
2022-06-20 20:49:18 +02:00
David Pedersen
fabb205a9e
axum: Version 0.5.9 ( #1108 )
2022-06-20 13:44:15 +02:00
David Pedersen
7f203b96e6
Fix build with form feature without headers feature ( #1107 )
...
Fixes #1106
2022-06-20 09:14:21 +02:00
David Pedersen
5ac0b2b3d7
axum: Version 0.5.8 ( #1104 )
2022-06-18 11:38:52 +02:00
David Pedersen
7deaff7e1e
axum-core: Version 0.2.6 ( #1103 )
2022-06-18 11:00:19 +02:00
David Pedersen
2f64064650
Implement IntoResponse for Form ( #1095 )
2022-06-17 18:23:57 +00:00
David Pedersen
93251fa203
Bump MSRV to 1.56 and update to the 2021 edition ( #1098 )
2022-06-17 20:11:35 +02:00
David Pedersen and Jonas Platte
fd70f81c46
More robust asset paths in examples ( #1090 )
...
* More robust asset paths in examples
* Update examples/low-level-rustls/src/main.rs
Co-authored-by: Jonas Platte <[email protected] >
* format
Co-authored-by: Jonas Platte <[email protected] >
2022-06-15 22:42:49 +02:00
David Pedersen
ad67289226
Add table of contents to some modules ( #1084 )
2022-06-14 14:10:04 +02:00
David Pedersen and Jonas Platte
dbdbd0165e
Support Forwarded in Host extractor ( #1078 )
...
* Support `Forwarded` in `Host` extractor
* changelog
* Update axum/src/extract/host.rs
Co-authored-by: Jonas Platte <[email protected] >
* look for `host` key
Co-authored-by: Jonas Platte <[email protected] >
2022-06-10 22:30:01 +02:00
David Pedersen
f66893fbda
Add missing version for serde_json in Cargo.toml
...
No idea how that went away
2022-06-10 16:57:53 +02:00
David Pedersen
968ee44631
Sort dependencies in Cargo.tomls ( #1076 )
...
* sort dependencies
* check sorted deps on CI
* this should fail
* does caching matter?
* fix sorting
2022-06-10 08:59:17 +02:00
David Pedersen
453202b490
Document all cargo features ( #1079 )
2022-06-10 08:46:09 +02:00
David Pedersen
b6a2d9dba7
Use consistent todo comment casing
2022-06-09 20:47:23 +02:00
David Pedersen
7aa3f35129
axum: Version 0.5.7 ( #1075 )
2022-06-08 16:08:11 +02:00
David Pedersen
fbb4786851
axum-extra: Version 0.3.4 ( #1074 )
2022-06-08 15:58:37 +02:00
David Pedersen
a9eb4ac527
axum-core: Version 0.2.5 ( #1073 )
2022-06-08 15:56:56 +02:00
David Pedersen
ef750799fa
Automatically handle http_body::LengthLimitError ( #1048 )
...
* Automatically handle `http_body::LengthLimitError`
* add tower-http dev dep to axum-core
* just make it a link
* Make `FailedToBufferBody` an enum
* Fix tests now that tower-http handles `Content-Length`
* Bring back explanation for `LengthLimitError`
* remove todo we likely can't fix
* improve wording in docs
2022-06-08 13:47:57 +00:00
David Pedersen
73b1bafbf8
Add AsyncReadBody ( #1072 )
...
* Add `AsyncReadBody`
* changelog
* sort cargo.toml
2022-06-08 11:02:42 +02:00
David Pedersen
115a47b191
Remove tower's buffer feature ( #1071 )
...
Turns out we're not using it anymore and it saves depending on tokio-util.
2022-06-08 07:58:56 +00:00
David Pedersen
0936a246bf
Add extract::ws::close_code which contains constants for close codes ( #1067 )
...
The values and docs are copied from [tungstenite].
Fixes #1061
[tungstenite]: https://docs.rs/tungstenite/0.17.2/src/tungstenite/protocol/frame/coding.rs.html#119-188
2022-06-08 09:36:59 +02:00
David Pedersen
8ff275499b
Add #1049 to changelogs
2022-06-06 18:00:52 +02:00
David Pedersen
6c10f41d94
Support Path<Vec<(String, String)>> ( #1059 )
...
* Support `Path<Vec<(String, String)>>`
* changelog
2022-05-27 14:11:33 +02:00
David Pedersen
19fe93262f
Use impl IntoResponse less in docs ( #1049 )
2022-05-22 13:41:29 +02:00
David Pedersen
5948cde6c1
Support customizing rejections for #[derive(TypedPath)] ( #1012 )
...
* Support customizing rejections for `#[derive(TypedPath)]`
* changelog
* clean up
2022-05-17 21:36:05 +02:00
David Pedersen
be71e7b286
Fix vulnerability in example-stream-to-file example ( #1040 )
...
* Fix vulnerability in example-stream-to-file example
* Save files to separate directory
2022-05-17 12:38:15 +02:00
David Pedersen
7d88bd3a66
Check for multiple body extractors in debug_handler ( #1036 )
...
* Check for multiple body extractors in `debug_handler`
* changelog link
2022-05-16 14:11:40 +00:00
David Pedersen
05529c8efc
Check Request and Path in debug_handler ( #1035 )
...
* Check `Request` and `Path` in `debug_handler`
* changelog links
* Include errors with the input
2022-05-16 10:05:17 +00:00
David Pedersen
316e20fbd9
axum: Version 0.5.6 ( #1033 )
2022-05-15 23:05:00 +02:00
David Pedersen
3e722379ac
Add changelog link
2022-05-15 20:07:29 +02:00
David Pedersen
61c4e19598
axum-extra: 0.3.2 ( #1034 )
2022-05-15 20:01:00 +02:00
David Pedersen
a8e2390724
Add axum-tungstenite to ecosystem
2022-05-15 17:26:52 +02:00
David Pedersen
178e1801e9
Add axum_extra::extract::Form ( #1031 )
...
* Add `axum_extra::extra::Form`
* update tokio-util ban
2022-05-15 15:17:45 +00:00
David Pedersen
0b856b938f
Document "debugging handler type errors" on Handler ( #1024 )
2022-05-11 20:56:57 +02:00
David Pedersen and Jonas Platte
08cbade3cb
Improve Path error when its extracted multiple times ( #1023 )
...
* Improve `Path` error
* Improve docs
* changelog
* Update axum/src/extract/path/mod.rs
Co-authored-by: Jonas Platte <[email protected] >
* fix test
Co-authored-by: Jonas Platte <[email protected] >
2022-05-11 11:38:37 +02:00
David Pedersen
cfdac03c8d
axum-extra: Version 0.3.1 ( #1016 )
2022-05-10 12:05:36 +00:00
David Pedersen
46e6d3493b
axum-macros: Version 0.2.1 ( #1015 )
2022-05-10 11:46:17 +00:00
David Pedersen
96aaac4865
axum: Version 0.5.5 ( #1014 )
2022-05-10 11:43:08 +00:00
David Pedersen
2353ee788c
Make docs around extracting Request more explicit ( #1013 )
2022-05-10 11:00:57 +00:00
David Pedersen
7774cfd1f7
Update static file server example ( #1011 )
2022-05-08 19:52:34 +00:00
David Pedersen
852e548e19
Support #[derive(FromRequest)] on enums ( #1009 )
...
* Support `#[from_request(via(...))]` on enums
* Check `#[from_request]` on variants
* check for non enum/struct and clean up
* changelog
* changelog
* remove needless feature
* changelog ref
2022-05-08 20:04:56 +02:00
David Pedersen
a3a32f493e
Add MethodRouter::{into_make_service, into_make_service_with_connect_info} ( #1010 )
2022-05-08 19:48:48 +02:00
David Pedersen
6bd726f4a9
Refactor #[derive(FromRequest)] to make illegal state unrepresentable ( #1004 )
2022-05-06 16:53:12 +02:00
David Pedersen
b5183afbec
Support wildcards in typed paths ( #1003 )
...
* Support wildcards in typed paths
* changelog
2022-05-06 13:05:30 +02:00
David Pedersen and Jonas Platte
4ff78e552d
Support Option and Result in typed paths ( #1001 )
...
* Support `Option` and `Result` in typed paths
* changelog
* Update axum-extra/CHANGELOG.md
Co-authored-by: Jonas Platte <[email protected] >
* fix one more
Co-authored-by: Jonas Platte <[email protected] >
2022-05-06 09:42:10 +02:00
d19beffd6d
Handle GET, HEAD, and OPTIONS correctly in ContentLengthLimit ( #989 )
...
* Handle `GET`/`HEAD`/`OPTIONS` in `ContentLengthLimit`
* changelog
* Apply suggestions from code review
Co-authored-by: Marcus Griep <[email protected] >
* Don't allow GET/HEAD/OPTIONS with `transfer-encoding: chunked`
* simplify constructing chunked body
* Update axum/src/extract/content_length_limit.rs
Co-authored-by: Jonas Platte <[email protected] >
Co-authored-by: Marcus Griep <[email protected] >
Co-authored-by: Jonas Platte <[email protected] >
2022-05-05 09:17:54 +02:00
David Pedersen
d1043db254
Fix driving readiness for example-rest-grpc-multiplex ( #988 )
2022-05-03 09:21:49 +00:00
David Pedersen
5be73c1064
axum-core: Version 0.2.4 ( #984 )
2022-05-02 11:52:24 +02:00
David Pedersen
8dd6070574
Implement IntoResponse for (Parts | Request<()>, $(impl IntoResponseParts)+, impl IntoResponse) ( #980 )
...
* Implement `IntoResponse for (Parts | Request<()>, $(impl IntoResponseParts)+, impl IntoResponse)`
Fixes #979
* changelog
* docs
* changelog ref
2022-04-29 22:08:47 +02:00
David Pedersen
1fe4558362
Move examples to separate workspace ( #978 )
...
* Move examples to separate workspace
* update commands to run examples
* remove debug
2022-04-29 18:53:41 +02:00
David Pedersen
5bb924b3a2
Implement IntoResponse and IntoResponseParts for http::Extensions ( #975 )
...
* Implement `IntoResponse` and `IntoResponseParts` for `http::Extensions`
Requires a new release of `http`.
* remove http patch
* changelog ref
2022-04-29 17:28:24 +02:00
David Pedersen
a3b6cbc99c
axum-extra: Version 0.3.0 ( #974 )
...
* axum-extra: Version 0.3.0
* add tower-http update to changelog
2022-04-27 10:27:41 +02:00
David Pedersen
700617963f
Move private and signed cookies behind feature flags ( #949 )
...
* move signed cookies into their own module
* Require features for private/signed cookies
* enable "cookie" feature when enabling private/signed cookies
* add `#[cfg]`s in a few more places
2022-04-27 10:11:16 +02:00
David Pedersen
a723ed1453
axum: Version 0.5.4 ( #973 )
2022-04-26 16:50:44 +02:00
David Pedersen
0702c59c7d
axum-core: Version 0.2.3 ( #966 )
2022-04-26 14:19:47 +00:00
David Pedersen
23f20ea1f3
Replace ByteStr with Arc<str> ( #971 )
2022-04-26 10:16:38 +02:00
David Pedersen
79f6cde3b1
Update to tower-http 0.3.0 ( #965 )
...
* Update to tower-http 0.3.0
* changelog link
2022-04-25 14:59:16 +00:00
David Pedersen and Jonas Platte
061e66c236
axum: Version 0.5.3 ( #947 )
...
* axum: Version 0.5.3
* Update axum/CHANGELOG.md
Co-authored-by: Jonas Platte <[email protected] >
Co-authored-by: Jonas Platte <[email protected] >
2022-04-19 17:00:51 +02:00
David Pedersen
2adb34c8aa
Revert "Allow Error: Into<Infallible> for Route::{layer, route_layer} ( #924 )" ( #946 )
...
This reverts commit ca7ecb159b .
2022-04-19 16:47:27 +02:00
David Pedersen
883a1cfd8f
axum: Version 0.5.2
2022-04-19 16:19:43 +02:00
David Pedersen
598e6935df
axum-core: Version 0.2.2
2022-04-19 16:17:52 +02:00
David Pedersen
ca7ecb159b
Allow Error: Into<Infallible> for Route::{layer, route_layer} ( #924 )
...
* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}`
Fixes https://github.com/tokio-rs/axum/issues/922
* changelog
2022-04-19 16:16:54 +02:00
David Pedersen
afcefb4a70
Add AppendHeaders ( #927 )
...
* Add `AppendHeaders`
* axum changelog
2022-04-17 23:14:04 +02:00
David Pedersen
3e716f303f
axum: Version 0.5.1
2022-04-03 20:23:18 +02:00
David Pedersen
bcda1a97db
axum-core: Version 0.2.1
2022-04-03 20:21:16 +02:00