Skip to content

Commit e503dc9

Browse files
fix: use correct type when validating EF header regex (#6602)
1 parent 8ebd4f5 commit e503dc9

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

packages/edge-bundler/node/validation/manifest/__snapshots__/index.test.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ ENUM must be equal to one of the allowed values
188188
189189
exports[`route headers > should throw on invalid pattern format 1`] = `
190190
[ManifestValidationError: Validation of Edge Functions manifest failed
191-
FORMAT must match format "regexPattern"
191+
TYPE must be string
192192
193193
15 | "x-custom-header": {
194194
16 | "matcher": "regex",
195-
> 17 | "pattern": "/^Bearer .+/"
196-
| ^^^^^^^^^^^^^^ 👈🏽 format must match format "regexPattern"
195+
> 17 | "pattern": {}
196+
| ^^ 👈🏽 type must be string
197197
18 | }
198198
19 | }
199199
20 | }]

packages/edge-bundler/node/validation/manifest/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ describe('route headers', () => {
209209
manifest.routes[0].headers = {
210210
'x-custom-header': {
211211
matcher: 'regex',
212-
pattern: '^Bearer .+$',
212+
pattern: 'Bearer .+',
213213
},
214214
}
215215

@@ -254,7 +254,7 @@ describe('route headers', () => {
254254
manifest.routes[0].headers = {
255255
'x-custom-header': {
256256
matcher: 'regex',
257-
pattern: '/^Bearer .+/',
257+
pattern: /^Bearer .+/,
258258
},
259259
}
260260

packages/edge-bundler/node/validation/manifest/schema.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const headersSchema = {
2727
properties: {
2828
pattern: {
2929
type: 'string',
30-
format: 'regexPattern',
3130
},
3231
matcher: {
3332
type: 'string',

0 commit comments

Comments
 (0)