* 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>
* Fix status codes for `JsonRejection` rejections
Fixes#865
* Apply suggestions from code review
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
* Add `IntoResponseParts`
* docs
* Add test
* don't allow overriding body or response
* macroify impls
* re-order things a bit
* Fix tests
* Also allow overriding version
* Move things into separate modules
* docs
* clean up
* fix trybuild test
* remove churn
* simplify buliding response
* fixup test
* fix docs typo
* Use `HeaderValue::from_static`, might be faster
* Bring back `impl IntoResponse` in example
* Remove blanket impl to improve error message
* don't need to set `content-type`
* Apply suggestions from code review
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
* changelog
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
* Add sqlx example with migrations
Simple use case for sqlx based on tokio postgres example.
Sqlite database is created on execution in ./target directory
and migrations are then run against it.
* sqlx example uses postgres instead of sqlite3
Also removed migrations and database creation code.
* Change `HeaderMap` extractor to clone the headers
* fix docs
* changelog
* inline variable
* also add changelog item to axum
* don't list types from axum in axum-core's changelog
* document that `HeaderMap::from_request` clones the headers
* fix typo
* a few more typos
* Use 308 status instead of 301 when redirecting
For redirects resulting from requests to paths with a trailing slash,
use 308 instead of 301 to prevent non-GET requests (POST, PUT, etc) from
being changed to GET.
For example, (assuming a route for /path is defined)...
- Old behavior results in:
POST /path/ -> GET /path
- New behavior results in:
POST /path/ -> POST /path
Fixes#681
* Add deprecation notice to found()
Deprecates found() due to its use of HTTP 302
* rustfmt
* Use dedicated redirect method
Use Redirect::permanent instead of re-implementing its functionality
* Remove deprecated method from example
Replace usages of Redirect:found with Redirect::to and Redirect::temporary as appropriate
* Fix panic in oauth example
Previously the example would panic if a request was made without the
`Cookie` header. Now the user is redirected to the login page as
expected.
* Update CHANGELOG
* Revert pub TypedheaderRejection fields
* Fix clippy lint
* cargo fmt
* Fix CHANGELOG link
* Adhere to implicit line length limit
* Simplify json content-type check
* Import HeaderMap from http instead of from headers
The headers crate is an optional dependency and its HeaderMap re-export
is `#[doc(hidden)]`.
* Use headers re-export in axum in examples
* Add `middleware::from_fn` for creating middleware from async fns
* More trait impls for `Next`
* Make `Next::run` consume `self`
* Use `.router_layer` in example, since middleware returns early
* Actually `Next` probably shouldn't impl `Clone` and `Service`
Has implications for backpressure and stuff
* Simplify `print-request-response` example
* Address review feedback
* add changelog link
* Provide more error in `Path` deserialization error
* Rename
* Add error kind for deserializing sequences
* Rename
* Fix wrong docs
* Rename `MissingRouteParams`
* Rename error to have more consistency
* Rename internal error
* Update changelog
* One last renaming, for now
* Add tests
* Tweak changelog a bit