Skip to content

Commit 728ae1d

Browse files
fix: resolve formatting issues in CORS validation code
Co-Authored-By: eshen@cloudflare.com <emilyshen2k@gmail.com>
1 parent fcdbe37 commit 728ae1d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

packages/wrangler/src/r2/helpers.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,19 +1364,19 @@ const CORSRuleSchema = z.object({
13641364
maxAgeSeconds: z.number().int().min(0).optional(),
13651365
});
13661366

1367-
const CORSConfigSchema = z.object({
1368-
rules: z
1369-
.array(CORSRuleSchema)
1370-
.min(
1371-
1,
1372-
"The CORS configuration must contain at least one rule in the 'rules' array."
1373-
),
1374-
}).refine(
1375-
(data) => "rules" in data,
1376-
{
1377-
message: "The CORS configuration file must contain a 'rules' array as expected by the request body of the CORS API: https://developers.cloudflare.com/api/operations/r2-put-bucket-cors-policy",
1378-
}
1379-
);
1367+
const CORSConfigSchema = z
1368+
.object({
1369+
rules: z
1370+
.array(CORSRuleSchema)
1371+
.min(
1372+
1,
1373+
"The CORS configuration must contain at least one rule in the 'rules' array."
1374+
),
1375+
})
1376+
.refine((data) => "rules" in data, {
1377+
message:
1378+
"The CORS configuration file must contain a 'rules' array as expected by the request body of the CORS API: https://developers.cloudflare.com/api/operations/r2-put-bucket-cors-policy",
1379+
});
13801380

13811381
export function validateCORSRules(
13821382
corsConfig: unknown,

0 commit comments

Comments
 (0)