Skip to content

Commit

Permalink
Update middleware route (vercel#6863)
Browse files Browse the repository at this point in the history
  • Loading branch information
javivelasco authored Oct 19, 2021
1 parent 3d7e01e commit 2105d31
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 30 deletions.
15 changes: 1 addition & 14 deletions packages/routing-utils/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,7 @@ export const routesSchema = {
},
},
middleware: {
type: 'object',
required: ['id', 'type'],
additionalProperties: false,
properties: {
id: {
type: 'string',
maxLength: 256,
},
type: {
type: 'string',
maxLength: 32,
enum: ['v8-worker'],
},
},
type: 'number',
},
has: hasSchema,
},
Expand Down
5 changes: 1 addition & 4 deletions packages/routing-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ export type Source = {
redirect?: Record<string, string>;
cookie?: string;
};
middleware?: {
id: string;
type: 'v8-worker';
};
middleware?: number;
};

export type Handler = {
Expand Down
5 changes: 1 addition & 4 deletions packages/routing-utils/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ describe('normalizeRoutes', () => {
},
{
src: '^/.*$',
middleware: {
id: '1',
type: 'v8-worker',
},
middleware: 0,
},
{ handle: 'filesystem' },
{ src: '^/(?<slug>[^/]+)$', dest: 'blog?slug=$slug' },
Expand Down
10 changes: 2 additions & 8 deletions packages/routing-utils/test/merge.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,7 @@ test('mergeRoutes ensure beforeFiles comes after redirects (check)', () => {
},
{
src: '^/.*$',
middleware: {
id: '1',
type: 'v8-worker',
},
middleware: 0,
},
{
handle: 'filesystem',
Expand All @@ -517,10 +514,7 @@ test('mergeRoutes ensure beforeFiles comes after redirects (check)', () => {
},
{
src: '^/.*$',
middleware: {
id: '1',
type: 'v8-worker',
},
middleware: 0,
},
{ handle: 'filesystem' },
{ src: '^/404$', dest: '/404', status: 404, check: true },
Expand Down

0 comments on commit 2105d31

Please sign in to comment.