Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fixing link errors #1226

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions axum/src/docs/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ let app = Router::new()

Some commonly used middleware are:

- [`TraceLayer`](tower_http::trace) for high level tracing/logging.
- [`CorsLayer`](tower_http::cors) for handling CORS.
- [`CompressionLayer`](tower_http::compression) for automatic compression of
- [`TraceLayer`] for high level tracing/logging.
- [`CorsLayer`] for handling CORS.
- [`CompressionLayer`] for automatic compression of
responses.
- [`RequestIdLayer`](tower_http::request_id) and
[`PropagateRequestIdLayer`](tower_http::request_id) set and propagate request
- [`RequestIdLayer`] and
[`PropagateRequestIdLayer`] set and propagate request
ids.
- [`TimeoutLayer`](tower::timeout::TimeoutLayer) for timeouts. Note this
requires using [`HandleErrorLayer`](crate::error_handling::HandleErrorLayer)
- [`TimeoutLayer`] for timeouts. Note this
requires using [`HandleErrorLayer`]
to convert timeouts to responses.

# Ordering
Expand Down Expand Up @@ -133,7 +133,7 @@ return early and not call the next layer, for example if a request cannot be
authorized, but its a useful mental model to have.

As previously mentioned its recommended to add multiple middleware using
`tower::ServiceBuilder`, however this impacts ordering:
[`tower::ServiceBuilder`], however this impacts ordering:

```rust
use tower::ServiceBuilder;
Expand Down Expand Up @@ -320,7 +320,7 @@ let app = Router::new()
# };
```

See [`error_handling`](crate::error_handling) for more details on axum's error
See [`error_handling`] for more details on axum's error
handling model.

# Routing to services/middleware and backpressure
Expand Down Expand Up @@ -461,3 +461,11 @@ extensions you need.
[`MethodRouter::route_layer`]: crate::routing::MethodRouter::route_layer
[request extensions]: https://docs.rs/http/latest/http/request/struct.Request.html#method.extensions
[Response extensions]: https://docs.rs/http/latest/http/response/struct.Response.html#method.extensions
[`TraceLayer`]: tower_http::trace::TraceLayer
[`CorsLayer`]: tower_http::cors::CorsLayer
[`CompressionLayer`]: tower_http::compression::CompressionLayer
[`RequestIdLayer`]: tower_http::request_id::SetRequestIdLayer
[`PropagateRequestIdLayer`]: tower_http::request_id::PropagateRequestIdLayer
[`TimeoutLayer`]: tower::timeout::TimeoutLayer
[`HandleErrorLayer`]: crate::error_handling::HandleErrorLayer
[`error_handling`]: crate::error_handling