fix: redirect /dashboard to /dashboard/ (#5369)

* fix: redirect /dashboard to /dashboard/

* test: update integration test
This commit is contained in:
Ning Sun
2025-01-16 11:04:08 +08:00
committed by GitHub
parent 4f29e50ef3
commit 725d5a9e68
3 changed files with 25 additions and 16 deletions

View File

@@ -999,9 +999,11 @@ pub async fn test_dashboard_path(store_type: StorageType) {
let (app, _guard) = setup_test_http_app_with_frontend(store_type, "dashboard_path").await;
let client = TestClient::new(app);
let res_post = client.post("/dashboard").send().await;
assert_eq!(res_post.status(), StatusCode::OK);
let res_get = client.get("/dashboard").send().await;
assert_eq!(res_get.status(), StatusCode::PERMANENT_REDIRECT);
let res_post = client.post("/dashboard/").send().await;
assert_eq!(res_post.status(), StatusCode::OK);
let res_get = client.get("/dashboard/").send().await;
assert_eq!(res_get.status(), StatusCode::OK);
// both `GET` and `POST` method return same result