From bdcf017d66c93cfd57893ef28df48d2e94d61b56 Mon Sep 17 00:00:00 2001 From: darkweak Date: Tue, 5 Nov 2024 21:34:35 +0100 Subject: [PATCH] fix(key): return stars to show key is hidden --- docs/e2e/Souin E2E.postman_collection.json | 4 ++-- pkg/rfc/cache_status.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/e2e/Souin E2E.postman_collection.json b/docs/e2e/Souin E2E.postman_collection.json index 9c8aba953..2c118f9ba 100644 --- a/docs/e2e/Souin E2E.postman_collection.json +++ b/docs/e2e/Souin E2E.postman_collection.json @@ -3498,7 +3498,7 @@ " pm.response.to.have.status(200);", " if (exclude) {", " pm.response.to.have.header(\"Cache-Status\");", - " pm.expect(pm.response.headers.get(\"Cache-Status\")).to.eql(\"Souin; fwd=uri-miss; key=; detail=CANNOT-HANDLE\");", + " pm.expect(pm.response.headers.get(\"Cache-Status\")).to.eql(\"Souin; fwd=uri-miss; key=*****; detail=CANNOT-HANDLE\");", " } else {", " pm.response.to.have.header(\"Cache-Status\");", " if (isStore) {", @@ -3516,7 +3516,7 @@ " expected.to.have.status(200);", " if (exclude) {", " pm.response.to.have.header(\"Cache-Status\");", - " pm.expect(pm.response.headers.get(\"Cache-Status\")).to.eql(\"Souin; fwd=uri-miss; key=; detail=CANNOT-HANDLE\");", + " pm.expect(pm.response.headers.get(\"Cache-Status\")).to.eql(\"Souin; fwd=uri-miss; key=*****; detail=CANNOT-HANDLE\");", " } else {", " expected.to.have.header(\"Cache-Status\");", "", diff --git a/pkg/rfc/cache_status.go b/pkg/rfc/cache_status.go index f02132fb7..804f8da16 100644 --- a/pkg/rfc/cache_status.go +++ b/pkg/rfc/cache_status.go @@ -67,7 +67,7 @@ func GetCacheKeyFromCtx(currentCtx ctx.Context) string { } } - return "" + return "*****" } // MissCache set miss fwd