From 35c01238c63ba1d0d6cc274258d23c82681bdbbf Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Fri, 2 Jun 2023 11:08:12 +0200 Subject: [PATCH] fix: status code when in denylist (#160) --- packages/edge-gateway/src/utils/verification.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/edge-gateway/src/utils/verification.js b/packages/edge-gateway/src/utils/verification.js index d5c9472..4c2fec1 100644 --- a/packages/edge-gateway/src/utils/verification.js +++ b/packages/edge-gateway/src/utils/verification.js @@ -1,3 +1,5 @@ +/* global Response */ + import { ACCEPTABLE_CID_VERIFIER_STATUS_CODES, ACCEPTABLE_DENYLIST_STATUS_CODES @@ -16,7 +18,7 @@ export async function getCidForbiddenResponse (cid, env) { ]) if (!ACCEPTABLE_DENYLIST_STATUS_CODES.includes(cidDenylistResponse.status)) { - return cidDenylistResponse + return new Response('', { status: 410 }) } // cidVerifierResponse will be null if env.isCidVerifierEnabled is false.