Skip to content

fix(app-server): attach API middleware stack#340

Open
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-app-server-middleware-stack
Open

fix(app-server): attach API middleware stack#340
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-app-server-middleware-stack

Conversation

@OnlyYu1996
Copy link
Copy Markdown

Summary

  • attach the existing app-server rate-limit, content-type, timeout, and security-header middleware to /api/v1 routes
  • reuse the configured CORS layer instead of always using permissive CORS
  • preserve existing Axum 0.7-style route syntax compatibility so the app-server router can be constructed under Axum 0.8
  • add router-level regression coverage for rate limiting, timeout, content-type rejection, and security headers

Fixes PlatformNetwork/bounty-challenge#53530.

Validation

  • cargo +stable fmt --package cortex-app-server --check
  • cargo +stable test --package cortex-app-server create_router_applies -- --nocapture
  • cargo +stable check --package cortex-app-server --lib
  • git diff --check

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] [v0.0.7] app-server rate_limit/timeout/security-header middlewares are defined but never attached to the router

1 participant