1
0
Fork 0
mirror of https://github.com/tokio-rs/axum.git synced 2025-01-26 01:44:54 +01:00
Commit graph

693 commits

Author SHA1 Message Date
takumi
4b384fa01c
upgrade uuid from 0.8 to 1.0 () 2022-05-05 07:48:49 +02:00
Conrad
002cff5c79
fix link about backpressure from routing section () 2022-05-04 06:07:24 +00:00
Thomas Scholtes
8cc052f38b
Make Path extractor work with Deserialize impls using &str ()
* `Path` extractor works with `Deserialize` impls using `&str`

Before this change the extractor `Path<Test>` would fail if the
`Deserialize` implementation of `Test` was calling
`Deserializer::deserialize_str()`.

Now we use `Visitor::visit_borrowed_str()` instead of
`Visitor::visit_str()` which is also recommended in the guide to
implement a deserializer [1].

[1]: https://serde.rs/impl-deserializer.html

* fixup! `Path` extractor works with `Deserialize` impls using `&str`

* add test for percent decoding

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-05-03 18:44:58 +00:00
David Pedersen
d1043db254
Fix driving readiness for example-rest-grpc-multiplex () 2022-05-03 09:21:49 +00:00
Gabriel Lacroix
d2fab9245b
Fix some typos and grammatical mistakes () 2022-05-03 06:30:17 +00:00
takumi
4ff5e409e3
Add rest and grpc example ()
* Add rest and grpc example

* remove needless dependencies

* Apply suggestions from code review

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

* Update examples/rest-grpc-multiplex/src/main.rs

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

* Update examples/rest-grpc-multiplex/src/main.rs

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

* Update examples/rest-grpc-multiplex/src/multiplex_service.rs

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

* Update examples/rest-grpc-multiplex/Cargo.toml

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

* Update examples/rest-grpc-multiplex/src/multiplex_service.rs

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

* clean noisy code

* fix nitpicks

* missing newline

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-05-02 15:52:55 +00:00
Rohan Jain
a223fd8b85
Ignore target directories in individual examples ()
These get created with `rust-analyzer`, which pollutes the git status
output.
2022-05-02 17:20:23 +02:00
David Pedersen
5be73c1064
axum-core: Version 0.2.4 () 2022-05-02 11:52:24 +02:00
David Pedersen
8dd6070574
Implement IntoResponse for (Parts | Request<()>, $(impl IntoResponseParts)+, impl IntoResponse) ()
* Implement `IntoResponse for (Parts | Request<()>, $(impl IntoResponseParts)+, impl IntoResponse)`

Fixes 

* changelog

* docs

* changelog ref
2022-04-29 22:08:47 +02:00
David Pedersen
1fe4558362
Move examples to separate workspace ()
* Move examples to separate workspace

* update commands to run examples

* remove debug
2022-04-29 18:53:41 +02:00
Marcus Griep
6e1835074c
Implement IntoResponse for Response<()> and response::Parts ()
* feat(axum-core): add IntoResponse for `http::response` types

* chore: narrow impl to `Response<()>`

* include extensions

* changelog

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-04-29 17:52:21 +02:00
David Pedersen
5bb924b3a2
Implement IntoResponse and IntoResponseParts for http::Extensions ()
* 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
Sergio C. Arteaga
d606728333
ecosystem: Add CLOMonitor to project showcase () 2022-04-27 15:32:51 +02:00
David Pedersen
a3b6cbc99c
axum-extra: Version 0.3.0 ()
* 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 ()
* 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 () 2022-04-26 16:50:44 +02:00
David Pedersen
0702c59c7d
axum-core: Version 0.2.3 () 2022-04-26 14:19:47 +00:00
David Pedersen
23f20ea1f3
Replace ByteStr with Arc<str> () 2022-04-26 10:16:38 +02:00
takumi
bc6fefb052
Remove needless map () 2022-04-26 09:15:04 +02:00
takumi
d6b79aea32
Add ignore .DS_Store () 2022-04-26 08:25:51 +02:00
David Pedersen
79f6cde3b1
Update to tower-http 0.3.0 ()
* Update to tower-http 0.3.0

* changelog link
2022-04-25 14:59:16 +00:00
Arniu Tseng
ebecac57a3
Add FromExtractor and deprecate extractor_middleware ()
* Add from_extractor and deprecate extractor_middleware

* Fix clippy warnings

* Update CHANGELOG.md

* Clean doc

* Add ExtractorMiddleware* back for compatibility

* Revert "Update CHANGELOG.md"

* remove dedundant docs

* allow re-exporting deprecated types

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-04-24 15:31:17 +00:00
Nahua
cb6fea37af
Edit readme to make community projects stand out as examples () 2022-04-24 12:49:15 +02:00
takumi
98795b7f75
Replace to_string with to_owned () 2022-04-24 08:05:00 +00:00
takumi
0d2c61c472
Remove needless borrow () 2022-04-24 08:03:54 +00:00
SEKUN
c1b51b5f6e
ecosystem: Add emojied.net to project showcase () 2022-04-23 17:03:20 +02:00
Nathaniel McCallum
8084b242d5
Add response::ErrorResponse and response::Result ()
* feat: add response::{Error, Result}

This type makes for efficient use of the `?` operator when in a function
with multiple return error types that all implement `IntoResponse`.

Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>

* misc adjustments from PR review

* Rename to `ErrorResponse` and `ResultResponse`

* nitpicky docs changes

* update changelog

* changelog wording

* Apply suggestions from code review

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

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-04-21 16:24:29 +02:00
Ian Purton
ec38c438e0
Add 'Rust on Nails' article to Axum ecosystem. () 2022-04-21 13:42:32 +02:00
David Pedersen
061e66c236
axum: Version 0.5.3 ()
* axum: Version 0.5.3

* Update axum/CHANGELOG.md

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

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-04-19 17:00:51 +02:00
David Pedersen
2adb34c8aa
Revert "Allow Error: Into<Infallible> for Route::{layer, route_layer} ()" ()
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} ()
* 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 ()
* Add `AppendHeaders`

* axum changelog
2022-04-17 23:14:04 +02:00
David Calavera
83e1a15040
Fix trailing redirection with query parameters ()
* Fix trailing redirection with query parameters

When the request URI matches a route that need a trailing slash, or has an extra trailing slash, the redirect URI is not generated correctly.

This change adds or removes a trailing slash to the path part of the URI, instead of the full URI, preserving query parameters during redirection.

Signed-off-by: David Calavera <david.calavera@gmail.com>

* Make trailing slash logic safer

Extract parts from Uri and recreate it, so it doesn't bump
into corner cases with string manipulation.

Signed-off-by: David Calavera <david.calavera@gmail.com>

* Remove extra assignment.

Signed-off-by: David Calavera <david.calavera@gmail.com>

* Update axum/src/routing/mod.rs

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

* changelog

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-04-17 21:12:52 +00:00
Slava
0313c08dc9
helpful note about posting with CORS () 2022-04-17 08:13:22 +00:00
Christos Hadjiaslanis
bef7700fcf
Add shuttle to ECOSYSTEM.md ()
shuttle is a serverless platform built for Rust, now with axum support!
2022-04-14 20:18:54 +02:00
zys864
d177a65f24
remove path::de "'any'" unneeded single quotes ()
* fix `route` module clippy warning

* remove `path::de` `"'any'"` unneeded singgle quotes,changes to `"any"`

Co-authored-by: zys864 <zys864@gmail.com>
2022-04-09 18:33:44 +02:00
zys864
f13eab893a
fix route module clippy warnings ()
Co-authored-by: zys864 <zys864@gmail.com>
2022-04-08 14:28:11 +02:00
zys864
a237edb7c3
Fix example-unix-domain-socket on non-unix platforms ()
* remove unused `axum`'s dependency:`tokio-util`

* fix `examples/todos`'s `async fn todos_index` iter_overeager_cloned

* Add docs to `/examples/async-graphql`, just like other xamples.

* remove `examples/async-graphql` unused dependencies `tracing-subscriber` and `trace`

* `examples/chat` deps `trace` and `tracing-subscriber` never be used. Add trace `debug` to `chat`

* remove `examples/print-request-response` unused dependency `axum-extra`

* remove `examples/prometheus-metrics` unused dependency `axum-extra`

* remove `examples/reverse-proxy` unused dependencies `tracing-subscriber` and `trace`

* `examples/chat` fmt fix

* fix `example-unix-domain-socket` compile error on not-unix platforms

Co-authored-by: zys864 <zys864@qq.com>
Co-authored-by: zys864 <zys864@gmail.com>
2022-04-08 11:29:52 +02:00
Fxxxlei
3747650ae9
Remove unnecessary default features for axum from axum-extra ()
* Remove unnecessary default features for axum from axum-extra

* Update changelog

Co-authored-by: Leon Felix List <uwdxx@student.kit.edu>
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-04-07 08:24:01 +00:00
Simon Sellar
59007d6111
Minor fixup of websocket example logging text. () 2022-04-06 10:33:34 +00:00
Grachev Mikhail
4c936dbb52
Fix a typo in CHANGELOG.md () 2022-04-04 09:26:39 +02:00
Tristan Bouchard
d417910a16
Add Field::chunk ()
* Added chunk function to multipart field

This fixes not being able to stream data from a multipart directly into a file or other output.

* doc comment for clarification of usage and &mut self

* fixed formatting

* Corrected example to reflex best practices

* Removed unwrap

* clean up docs

* update changelog

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-04-04 09:26:11 +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
David Pedersen
530b0906f7 Fix changelog date 2022-04-03 20:20:50 +02:00
David Pedersen
950dde2664 axum-extra: Version 0.2.1 2022-04-03 20:18:01 +02:00
David Pedersen
405e3f8c44
Add SpaRouter () 2022-04-03 18:29:37 +02:00
David Pedersen
2270cf7b3e
Add "stream to file" example ()
* Add "stream to file" example

* add title tag
2022-04-03 12:28:29 +02:00