1
0
Fork 0
mirror of https://github.com/tokio-rs/axum.git synced 2025-03-28 09:17:24 +01:00
Commit graph

782 commits

Author SHA1 Message Date
David Pedersen
329bd5f9b4
Support any middleware response that implements IntoResponse ()
* Support any middleware response that implements `IntoResponse`

* Require `Infallible` for middleware added with `Handler::layer`
2022-07-13 08:38:19 +00:00
Oskar
0a7fdd0b05
add HomeDisk to Project showcase () 2022-07-11 19:22:01 +02:00
David Pedersen
92dbbd3182
Return rejection if WebSocket request couldn't be upgraded ()
* 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 ()
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
Dominik Spicher
bc55362ba8
Fix typos in RequestParts docstrings () 2022-07-08 13:26:34 +00: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 ()
* Re-export `debug_handler` from axum

Fixes 

* 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 ()
Fixes 
2022-07-02 09:44:17 +00:00
Jonas Platte
8c31bee9bc
docsrs cfg fixes ()
* Remove unused attribute in axum-core

* Fix docs.rs package metadata for axum-extra
2022-07-01 13:35:52 +02:00
NicolaLS
34146f3139
Implement TryFrom<Method> for MethodFilter ()
* implement TryFrom<http::Method> for MethodFilter

* test for TryFrom<http::Method> for MethodFilter

* 'UnsupportedMethod' error type for MethodFilter

* Log TryFrom<http::Method> for MethodFilter

* adjust docs

* move docs

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-07-01 08:37:41 +00:00
David Pedersen
698b5ccf39 Update trybuilds for rust 1.62 2022-07-01 10:24:15 +02:00
David Pedersen
a4c820420d
Remove trailing slash redirects ()
* Prepare axum-next branch

* Remove deprecated `extractor_middleware` function ()

* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` ()

* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` ()

* 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` ()

* 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 <jplatte+git@posteo.de>

* Update axum-extra/src/routing/mod.rs

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

* fix typos in docs

* Update axum/CHANGELOG.md

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

* mention `RouterExt::route_with_tsr` in the changelog

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
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 ()
* 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} ()
* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` ()

* 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 () 2022-06-28 22:07:10 +02:00
David Pedersen
7e794e9d1d
axum: Version 0.5.10 () 2022-06-28 21:32:39 +02:00
David Pedersen
a8d0ce8c03
Fix possible panic when doing trailing slash redirect ()
* 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 <jplatte+git@posteo.de>

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-06-28 16:58:13 +02:00
David Pedersen
905bbfb8e2
axum-extra: Version 0.3.5 () 2022-06-27 21:08:12 +02:00
David Pedersen
b10c9d34bd
axum-macros: Version 0.2.3 () 2022-06-27 21:06:59 +02:00
David Pedersen
11179b8033
Silence "unnecessary use of to_string" lint for #[derive(TypedPath)] ()
* 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 () 2022-06-27 20:44:20 +02:00
David Pedersen
cb207472f4
Make Router faster to clone ()
* Make `Router` faster to clone

* changelog

* Update axum/src/routing/mod.rs

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

* fix

* Update axum/src/routing/mod.rs

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
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 () 2022-06-20 20:49:18 +02:00
David Pedersen
fabb205a9e
axum: Version 0.5.9 () 2022-06-20 13:44:15 +02:00
David Pedersen
7f203b96e6
Fix build with form feature without headers feature ()
Fixes 
2022-06-20 09:14:21 +02:00
David Pedersen
5ac0b2b3d7
axum: Version 0.5.8 () 2022-06-18 11:38:52 +02:00
David Pedersen
7deaff7e1e
axum-core: Version 0.2.6 () 2022-06-18 11:00:19 +02:00
Marcus Griep
2e2988b77d
minor update to aliri crates () 2022-06-18 08:06:31 +02:00
Jonas Platte
1812c4dfe8
Remove explicit TryFrom, TryInto imports () 2022-06-17 18:36:49 +00:00
David Pedersen
2f64064650
Implement IntoResponse for Form () 2022-06-17 18:23:57 +00:00
David Pedersen
93251fa203
Bump MSRV to 1.56 and update to the 2021 edition () 2022-06-17 20:11:35 +02:00
David Pedersen
fd70f81c46
More robust asset paths in examples ()
* More robust asset paths in examples

* Update examples/low-level-rustls/src/main.rs

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

* format

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-06-15 22:42:49 +02:00
Shing
cbb2e8a244
Fix missing assets in websockets example ()
* fix missing assets running websockets example

* Update examples/websockets/src/main.rs

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* remove unnecessary mut

* fix cargo fmt

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-06-15 10:04:44 +02:00
David Pedersen
ad67289226
Add table of contents to some modules () 2022-06-14 14:10:04 +02:00
David Bernard
18e45c4fdd
ECOSYSTEM.md: add axum-tracing-opentelemetry and sandbox_axum_observability ()
* ECOSYSTEM.md: add axum-tracing-opentelemetry and sandbox_axum_observability

* Update ECOSYSTEM.md

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-06-11 21:33:39 +02:00
David Pedersen
dbdbd0165e
Support Forwarded in Host extractor ()
* Support `Forwarded` in `Host` extractor

* changelog

* Update axum/src/extract/host.rs

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

* look for `host` key

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
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 ()
* 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 () 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 () 2022-06-08 16:08:11 +02:00
David Pedersen
fbb4786851
axum-extra: Version 0.3.4 () 2022-06-08 15:58:37 +02:00
David Pedersen
a9eb4ac527
axum-core: Version 0.2.5 () 2022-06-08 15:56:56 +02:00
David Pedersen
ef750799fa
Automatically handle http_body::LengthLimitError ()
* 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 ()
* Add `AsyncReadBody`

* changelog

* sort cargo.toml
2022-06-08 11:02:42 +02:00