From c30cf7e457343400f3a37b21f132dcfed15b0768 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sat, 10 Oct 2026 16:59:45 -0500 Subject: [PATCH] test(router): freeze the differential, application, WS and boot-error corpus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The parity corpus from ROUTER-CORPUS §2, with every expected output captured from ed47836 rather than written by hand. Matcher: 24 hand-picked scenarios (precedence, constraint ties, exact versus catch-all, equal-rank and same-pattern ties with reversed twins, implicit and explicit HEAD, streaming GETs, canonical Allow, encoding, case, Unicode and normalization) plus 40 scenarios from a fixed-seed generator (router-parity-gen-v1, seed 10908). The generated file stores the seed, the rules and every generated input; the test regenerates and requires a match, so changing the generator cannot move the baseline. Each scenario runs through the oracle and the live router and both must equal the capture, compared by declaration ID, decoded params, implicitHead, ordered Allow, or the normalization error. Application level: status, Allow, headers and body through app.fetch and a Node socket, including HEAD body suppression, 400/404/405 and OPTIONS. WebSocket, separate from HTTP: first-registered selection, an HTTP route at the same path not taking the upgrade, and the reserved mesh control path, through app.upgrade and the Node listener. This freezes one adapter disagreement as observed: a user @Ws('/__mesh__/control') on an app without mesh is refused by app.upgrade (1008) and served by the Node listener. Boot-time rejections: pattern compilation, local ambiguity and mesh splicing (duplicate exports, same-shape exports, local-over-remote precedence with its warning, and a remote static outranking a local parameter route). Refs #109 Signed-off-by: Diego Resendez --- test/router-parity/app.test.ts | 234 + test/router-parity/boot.test.ts | 315 + test/router-parity/cases.ts | 252 + test/router-parity/frozen/app-fetch.json | 597 + test/router-parity/frozen/app-node.json | 632 ++ test/router-parity/frozen/boot-app.json | 183 + test/router-parity/frozen/boot-mesh.json | 72 + test/router-parity/frozen/boot-patterns.json | 163 + .../frozen/matcher-generated.json | 9742 +++++++++++++++++ test/router-parity/frozen/matcher-hand.json | 3324 ++++++ test/router-parity/frozen/matcher-ws.json | 214 + test/router-parity/frozen/ws-app-upgrade.json | 151 + .../frozen/ws-http-same-path.json | 40 + .../router-parity/frozen/ws-node-upgrade.json | 149 + test/router-parity/generator.ts | 121 + test/router-parity/matcher.test.ts | 116 + test/router-parity/matcher.ts | 107 + test/router-parity/ws.test.ts | 183 + 18 files changed, 16595 insertions(+) create mode 100644 test/router-parity/app.test.ts create mode 100644 test/router-parity/boot.test.ts create mode 100644 test/router-parity/cases.ts create mode 100644 test/router-parity/frozen/app-fetch.json create mode 100644 test/router-parity/frozen/app-node.json create mode 100644 test/router-parity/frozen/boot-app.json create mode 100644 test/router-parity/frozen/boot-mesh.json create mode 100644 test/router-parity/frozen/boot-patterns.json create mode 100644 test/router-parity/frozen/matcher-generated.json create mode 100644 test/router-parity/frozen/matcher-hand.json create mode 100644 test/router-parity/frozen/matcher-ws.json create mode 100644 test/router-parity/frozen/ws-app-upgrade.json create mode 100644 test/router-parity/frozen/ws-http-same-path.json create mode 100644 test/router-parity/frozen/ws-node-upgrade.json create mode 100644 test/router-parity/generator.ts create mode 100644 test/router-parity/matcher.test.ts create mode 100644 test/router-parity/matcher.ts create mode 100644 test/router-parity/ws.test.ts diff --git a/test/router-parity/app.test.ts b/test/router-parity/app.test.ts new file mode 100644 index 0000000..000dbd3 --- /dev/null +++ b/test/router-parity/app.test.ts @@ -0,0 +1,234 @@ +/** + * Application-level router parity: what a client sees through `app.fetch` and through a real Node + * socket — status, `Allow`, response headers, and HEAD body suppression. Matcher equality alone + * cannot prove these: the 404/405/OPTIONS decisions, the 400 for a bad path and the HEAD body rule + * live in `src/http/core.ts`, around the matcher. + */ +import 'reflect-metadata'; +import http from 'http'; +import type { AddressInfo } from 'net'; +import { describe, it, beforeAll, afterAll } from 'vitest'; +import { createApp, Route, Get, Head, Post, Put, Patch, Delete, Options, Sse, Module, param } from '../../src/index'; +import type { App } from '../../src/app/types'; +import { frozen, expectFrozenEqual } from './frozen'; + +const reply = (id: string, params: Record) => ({ id, params }); + +// Ordered on purpose: the overlapping declarations are registered least-specific first, so a +// lookup that fell back to registration order would answer differently from one that ranks. +@Route('/') +class ParityHttp { + @Get('/a/:rest*') aRest(@param() p: Record) { + return reply('aRest', p); + } + @Get('/a/:id') aId(@param() p: Record) { + return reply('aId', p); + } + @Get('/a/b') aB(@param() p: Record) { + return reply('aB', p); + } + @Get('/users/:value') usersValue(@param() p: Record) { + return reply('usersValue', p); + } + @Get('/users/:id(\\d+)') usersId(@param() p: Record) { + return reply('usersId', p); + } + @Get('/n/:num(\\d+)') nNum(@param() p: Record) { + return reply('nNum', p); + } + @Get('/n/:code([0-9a-f]+)') nCode(@param() p: Record) { + return reply('nCode', p); + } + @Get('/files') files(@param() p: Record) { + return reply('files', p); + } + @Get('/files/:rest*') filesRest(@param() p: Record) { + return reply('filesRest', p); + } + @Get('/m') mGet(@param() p: Record) { + return reply('mGet', p); + } + @Post('/m') mPost(@param() p: Record) { + return reply('mPost', p); + } + @Get('/h') hGet(@param() p: Record) { + return reply('hGet', p); + } + @Head('/h') hHead(@param() p: Record) { + return reply('hHead', p); + } + @Sse('/stream') stream() { + return (async function* () { + yield { id: 'stream' }; + })(); + } + @Sse('/s/live') sLive() { + return (async function* () { + yield { id: 'sLive' }; + })(); + } + @Get('/s/:id') sId(@param() p: Record) { + return reply('sId', p); + } + @Get('/Case') caseUpper(@param() p: Record) { + return reply('caseUpper', p); + } + @Get('/u/:name') uName(@param() p: Record) { + return reply('uName', p); + } + @Get('/admin') admin(@param() p: Record) { + return reply('admin', p); + } + @Get('/public/:file') publicFile(@param() p: Record) { + return reply('publicFile', p); + } + @Delete('/r') rDelete(@param() p: Record) { + return reply('rDelete', p); + } + @Patch('/r') rPatch(@param() p: Record) { + return reply('rPatch', p); + } + @Options('/r') rOptions(@param() p: Record) { + return reply('rOptions', p); + } + @Put('/r') rPut(@param() p: Record) { + return reply('rPut', p); + } + @Get('/') root(@param() p: Record) { + return reply('root', p); + } +} + +@Module({ mountpoint: '/', controllers: [ParityHttp] }) +class ParityHttpModule {} + +type Req = [method: string, raw: string]; + +const REQUESTS: Req[] = [ + ['GET', '/a/b'], + ['GET', '/a/x'], + ['GET', '/a/x/y'], + ['GET', '/a'], + ['GET', '/users/42'], + ['GET', '/users/alice'], + ['GET', '/users/a%20b'], + ['GET', '/n/42'], + ['GET', '/n/ff'], + ['GET', '/files'], + ['GET', '/files/'], + ['GET', '/files/a%2Fb'], + ['GET', '/m'], + ['HEAD', '/m'], + ['OPTIONS', '/m'], + ['PUT', '/m'], + ['DELETE', '/m'], + ['POST', '/m'], + ['GET', '/h'], + ['HEAD', '/h'], + ['GET', '/stream'], + ['HEAD', '/stream'], + ['OPTIONS', '/stream'], + ['HEAD', '/s/live'], + ['HEAD', '/s/x'], + ['GET', '/absent'], + ['HEAD', '/absent'], + ['OPTIONS', '/absent'], + ['GET', '/users/%E0%A4%A'], + ['HEAD', '/users/%E0%A4%A'], + ['GET', '/a//b'], + ['GET', '/Case'], + ['GET', '/case'], + ['GET', '/caf%C3%A9'], + ['GET', '/u/caf%C3%A9'], + ['GET', '/public/../admin'], + ['GET', '/public/%2e%2e/admin'], + ['GET', '/public/..%2fadmin'], + ['GET', '/admin/'], + ['OPTIONS', '/r'], + ['HEAD', '/r'], + ['GET', '/r'], + ['PURGE', '/r'], // TRACE is a forbidden method for `new Request` + ['GET', '/'], + ['GET', '/?q=1'], +]; + +/** Headers that vary per run or per connection rather than per route decision. */ +const VOLATILE = new Set(['date', 'connection', 'keep-alive', 'x-request-id']); + +function stableHeaders(entries: Iterable<[string, string]>): Record { + const out: Record = {}; + for (const [name, value] of [...entries].sort(([a], [b]) => a.localeCompare(b))) + if (!VOLATILE.has(name)) out[name] = value; + return out; +} + +interface Observed { + method: string; + raw: string; + status: number; + headers: Record; + body: string; +} + +async function viaFetch(app: App, [method, raw]: Req): Promise { + // `new Request` applies the URL parser first — exactly what Deno, Bun and workerd do. + const res = await app.fetch(new Request(`http://parity.test${raw}`, { method })); + return { method, raw, status: res.status, headers: stableHeaders(res.headers), body: await res.text() }; +} + +function viaNode(port: number, [method, raw]: Req): Promise { + // `http.request` sends the path bytes as given, so the server sees the raw target. + return new Promise((resolve, reject) => { + const req = http.request({ host: '127.0.0.1', port, method, path: raw, agent: false }, (res) => { + let body = ''; + res.setEncoding('utf8'); + res.on('data', (chunk) => (body += chunk)); + res.on('end', () => { + const headers = Object.entries(res.headers).map(([k, v]): [string, string] => [ + k, + Array.isArray(v) ? v.join(', ') : String(v), + ]); + resolve({ method, raw, status: res.statusCode ?? 0, headers: stableHeaders(headers), body }); + }); + }); + req.on('error', reject); + req.end(); + }); +} + +describe('router parity: application-level HTTP outcomes', () => { + let fetchApp: App; + let nodeApp: App; + let port: number; + + beforeAll(async () => { + fetchApp = createApp({ modules: [ParityHttpModule] }); + nodeApp = createApp({ modules: [ParityHttpModule] }); + const server = await nodeApp.listen(0); + port = (server.address() as AddressInfo).port; + }); + + afterAll(async () => { + await nodeApp.close(); + }); + + it('app.fetch outcomes equal the frozen capture', async () => { + const run = async () => { + const out: Observed[] = []; + for (const req of REQUESTS) out.push(await viaFetch(fetchApp, req)); + return out; + }; + const expected = await frozen('app-fetch', run); + expectFrozenEqual(await run(), expected, 'app.fetch'); + }); + + it('Node listener outcomes equal the frozen capture', async () => { + const run = async () => { + const out: Observed[] = []; + for (const req of REQUESTS) out.push(await viaNode(port, req)); + return out; + }; + const expected = await frozen('app-node', run); + expectFrozenEqual(await run(), expected, 'node listener'); + }); +}); diff --git a/test/router-parity/boot.test.ts b/test/router-parity/boot.test.ts new file mode 100644 index 0000000..9c15121 --- /dev/null +++ b/test/router-parity/boot.test.ts @@ -0,0 +1,315 @@ +/** + * Boot-time rejection parity: invalid patterns, local ambiguity and mesh route splicing. These are + * not inputs to the differential matcher — a pattern that fails here never reaches a lookup — so + * they are frozen as their own expected-error fixture: the rejection point (pattern compile, app + * construction, mesh `ready()`), the error class and the exact message. + */ +import 'reflect-metadata'; +import type { AddressInfo } from 'net'; +import { describe, it } from 'vitest'; +import { createApp, Route, Get, Post, Sse, Ws, Module, param } from '../../src/index'; +import type { RouteDecorator } from '../../src/metadata'; +import type { Logger } from '../../src/logger'; +import * as live from '../../src/http/router'; +import * as oracle from './oracle'; +import { errorOutcome, type ErrorOutcome } from './matcher'; +import { frozen, expectFrozenEqual } from './frozen'; + +const PATTERNS = [ + '/', + '/users/:id', + '/users/:id(\\d+)', + '/files/:rest*', + '/:rest*', + '/t/', + '/café', + '/build/:version(\\d{2}\\.\\d{1,2})', + '/x/:id/:id', + '/x/:id/:rest*/tail', + '/x/:rest*/:rest*', + '/x/:', + '/x/:1x', + '/x//y', + 'x', + '', + '/x/:id((a+)+)', + '/x/:id((?=a)a)', + '/x/:id(\\1)', + '/x/:id(a|b)', + '/x/:id(\\d+\\w+)', + '/x/:id(\\d{5,2})', + '/x/:id(\\d{1,4096})', + '/x/:id(\\d+', + '/x/:id()', + `/x/:id(${'a'.repeat(129)})`, +]; + +type PatternOutcome = { pattern: string; shape: string } | { pattern: string; error: ErrorOutcome }; + +function compileAll(compile: (pattern: string) => { shape: string }): PatternOutcome[] { + return PATTERNS.map((pattern) => { + try { + return { pattern, shape: compile(pattern).shape }; + } catch (error) { + return { pattern, error: errorOutcome(error) }; + } + }); +} + +type Decl = [decorator: RouteDecorator, path: string]; + +/** One controller per case, its handlers declared in the given order (decorators applied by hand). */ +function moduleWith(decls: Decl[]) { + class ParityBoot {} + decls.forEach(([decorator, path], index) => { + const name = `h${index}`; + Object.defineProperty(ParityBoot.prototype, name, { + value: () => (async function* () {})(), + configurable: true, + }); + decorator(path)(ParityBoot.prototype, name, Object.getOwnPropertyDescriptor(ParityBoot.prototype, name)!); + }); + Route('/')(ParityBoot); + class ParityBootModule {} + Module({ mountpoint: '/', controllers: [ParityBoot] })(ParityBootModule); + return ParityBootModule; +} + +const APP_CASES: Array<{ id: string; decls: Decl[] }> = [ + { id: 'B01-duplicate-param', decls: [[Get, '/x/:id/:id']] }, + { id: 'B02-nonfinal-catch-all', decls: [[Get, '/x/:rest*/tail']] }, + { id: 'B03-nested-quantifier', decls: [[Get, '/x/:id((a+)+)']] }, + { id: 'B04-alternation', decls: [[Get, '/x/:id(a|b)']] }, + { id: 'B05-adjacent-unbounded', decls: [[Get, '/x/:id(\\d+\\w+)']] }, + { id: 'B06-inverted-quantifier', decls: [[Get, '/x/:id(\\d{5,2})']] }, + { id: 'B07-invalid-param-name', decls: [[Get, '/x/:1x']] }, + { id: 'B08-malformed-constraint', decls: [[Get, '/x/:id(\\d+']] }, + { + id: 'B09-same-shape-plain', + decls: [ + [Get, '/users/:id'], + [Get, '/users/:name'], + ], + }, + { + id: 'B10-same-shape-constrained', + decls: [ + [Get, '/c/:a(\\d+)'], + [Get, '/c/:b(\\d+)'], + ], + }, + { + id: 'B11-trailing-slash-twin', + decls: [ + [Get, '/t'], + [Get, '/t/'], + ], + }, + { + id: 'B12-get-and-ws-same-path', + decls: [ + [Get, '/live'], + [Ws, '/live'], + ], + }, + { + id: 'B13-get-and-sse-same-path', + decls: [ + [Get, '/feed'], + [Sse, '/feed'], + ], + }, + { + id: 'B14-ws-same-shape', + decls: [ + [Ws, '/w/:a'], + [Ws, '/w/:b'], + ], + }, + { + id: 'B15-ok-same-shape-different-methods', + decls: [ + [Get, '/users/:id'], + [Post, '/users/:name'], + ], + }, + { + id: 'B16-ok-different-constraints', + decls: [ + [Get, '/c/:a(\\d+)'], + [Get, '/c/:b([a-z]+)'], + ], + }, + { + id: 'B17-ok-static-and-param', + decls: [ + [Get, '/users/me'], + [Get, '/users/:id'], + ], + }, + { + id: 'B18-ok-exact-and-catch-all', + decls: [ + [Get, '/f'], + [Get, '/f/:rest*'], + ], + }, +]; + +const LABELS = new Map([ + [Get, '@Get'], + [Post, '@Post'], + [Sse, '@Sse'], + [Ws, '@Ws'], +]); + +function bootAll() { + return APP_CASES.map(({ id, decls }) => { + const declarations = decls.map(([decorator, path]) => `${LABELS.get(decorator)}('${path}')`); + try { + createApp({ modules: [moduleWith(decls)] }); + return { id, declarations, ok: true }; + } catch (error) { + return { id, declarations, error: errorOutcome(error) }; + } + }); +} + +// ── mesh ──────────────────────────────────────────────────────────────────────────────────────── + +const SECRET = 'parity-secret'; + +@Route('/dup') +class DupCtl { + @Get('/ping', { export: true }) ping() { + return { from: 'teapot' }; + } +} +@Module({ mountpoint: '/api', controllers: [DupCtl] }) +class DupTeapotModule {} + +@Route('/shape') +class ShapeIdCtl { + @Get('/:id', { export: true }) get(@param() p: Record) { + return { from: 'id', p }; + } +} +@Module({ mountpoint: '/api', controllers: [ShapeIdCtl] }) +class ShapeIdTeapotModule {} + +@Route('/shape') +class ShapeNameCtl { + @Get('/:name', { export: true }) get(@param() p: Record) { + return { from: 'name', p }; + } +} +@Module({ mountpoint: '/api', controllers: [ShapeNameCtl] }) +class ShapeNameTeapotModule {} + +// Same method and shape as the teapot's export: the local route wins, with a warning. +@Route('/dup') +class ShadowCtl { + @Get('/ping') local() { + return { from: 'local' }; + } +} +@Module({ mountpoint: '/api', controllers: [ShadowCtl] }) +class ShadowTeacupModule {} + +// A different shape that overlaps the export: no warning, and lookup ranks across local and remote. +@Route('/dup') +class OverlapCtl { + @Get('/:anything') local(@param() p: Record) { + return { from: 'local', p }; + } +} +@Module({ mountpoint: '/api', controllers: [OverlapCtl] }) +class OverlapTeacupModule {} + +@Route('/c') +class PlainCtl { + @Get('/ok') ok() { + return { from: 'teacup' }; + } +} +@Module({ mountpoint: '/', controllers: [PlainCtl] }) +class PlainTeacupModule {} + +type Ctor = new (...args: unknown[]) => unknown; + +function recordingLogger(): { logger: Logger; warnings: string[] } { + const warnings: string[] = []; + const noop = () => {}; + return { logger: { debug: noop, info: noop, error: noop, warn: (m) => warnings.push(m) }, warnings }; +} + +/** Starts one teapot per module and returns their control URLs plus a function that hides the ports. */ +async function teapots(modules: Ctor[]) { + const apps = modules.map((module) => createApp({ modules: [module], experimental: true, mesh: { secret: SECRET } })); + const servers = await Promise.all(apps.map((app) => app.listen(0))); + const urls = servers.map((s) => `ws://127.0.0.1:${(s.address() as AddressInfo).port}/__mesh__/control`); + const anonymize = (text: string) => urls.reduce((out, url, i) => out.split(url).join(``), text); + const close = () => Promise.all(apps.map((app) => app.close())); + return { urls, anonymize, close }; +} + +async function meshCase(id: string, teacupModule: Ctor, teapotModules: Ctor[], requests: string[]) { + const pots = await teapots(teapotModules); + const { logger, warnings } = recordingLogger(); + const teacup = createApp({ + modules: [teacupModule], + experimental: true, + logger, + mesh: { teapots: pots.urls.map((url) => ({ url, secret: SECRET })) }, + }); + + try { + await teacup.ready(); + const responses = []; + for (const path of requests) { + const res = await teacup.fetch(new Request(`http://parity.test${path}`)); + responses.push({ path, status: res.status, body: await res.text() }); + } + const routing = warnings.filter((w) => w.includes('precedence')).map(pots.anonymize); + return { id, ok: true, warnings: routing, responses }; + } catch (error) { + const { name, message } = errorOutcome(error); + return { id, error: { name, message: pots.anonymize(message) } }; + } finally { + await teacup.close(); + await pots.close(); + } +} + +async function meshAll() { + return [ + await meshCase('M01-two-teapots-same-route', PlainTeacupModule, [DupTeapotModule, DupTeapotModule], []), + await meshCase('M02-two-teapots-same-shape', PlainTeacupModule, [ShapeIdTeapotModule, ShapeNameTeapotModule], []), + await meshCase('M03-local-same-shape-wins', ShadowTeacupModule, [DupTeapotModule], ['/api/dup/ping']), + await meshCase('M04-unique-remote', PlainTeacupModule, [DupTeapotModule], ['/api/dup/ping', '/c/ok', '/api/nope']), + await meshCase( + 'M05-remote-static-outranks-local-param', + OverlapTeacupModule, + [DupTeapotModule], + ['/api/dup/ping', '/api/dup/x'], + ), + ]; +} + +describe('router parity: boot-time rejection', () => { + it('pattern compilation (oracle and live compilePattern) equals the frozen capture', async () => { + const expected = await frozen('boot-patterns', () => compileAll(live.compilePattern)); + expectFrozenEqual(compileAll(oracle.compilePattern), expected, 'oracle compilePattern'); + expectFrozenEqual(compileAll(live.compilePattern), expected, 'live compilePattern'); + }); + + it('createApp route-table validation equals the frozen capture', async () => { + const expected = await frozen('boot-app', bootAll); + expectFrozenEqual(bootAll(), expected, 'createApp'); + }); + + it('mesh route splicing equals the frozen capture', async () => { + const expected = await frozen('boot-mesh', meshAll); + expectFrozenEqual(await meshAll(), expected, 'mesh splice'); + }, 30_000); +}); diff --git a/test/router-parity/cases.ts b/test/router-parity/cases.ts new file mode 100644 index 0000000..27dd50d --- /dev/null +++ b/test/router-parity/cases.ts @@ -0,0 +1,252 @@ +/** + * Hand-picked matcher scenarios (ROUTER-CORPUS §2). Declaration IDs are stable across a scenario + * and its reversed twin, so a reversed run is compared by which declaration answered, not by which + * pattern text happens to sit first. + * + * Inputs only. The expected outputs live in `frozen/matcher-hand.json`, captured from the pinned + * revision; nothing in this file states what the answer should be. + */ +import type { Declaration, Request, Scenario, Transport } from './matcher'; + +type Decl = [id: string, method: string, pattern: string, transport?: Transport]; +type Req = [method: string, raw: string]; + +function scenario(id: string, note: string, decls: Decl[], reqs: Req[]): Scenario { + const declarations = decls.map(([declId, method, pattern, transport = 'buffer']): Declaration => ({ + id: declId, + method, + pattern, + transport, + })); + const requests = reqs.map(([method, raw]): Request => ({ method, raw })); + return { id, note, declarations, requests }; +} + +/** The same scenario with its declarations in reverse registration order. */ +function reversed(base: Scenario, id: string): Scenario { + return { ...base, id, note: `${base.note} (declarations reversed)`, declarations: [...base.declarations].reverse() }; +} + +const get = (...paths: string[]): Req[] => paths.map((path): Req => ['GET', path]); +const methods = (path: string, ...verbs: string[]): Req[] => verbs.map((verb): Req => [verb, path]); + +const rank = scenario( + 'H01-rank', + 'static beats plain param beats catch-all', + [ + ['catchAll', 'GET', '/a/:rest*'], + ['param', 'GET', '/a/:id'], + ['static', 'GET', '/a/b'], + ], + [...get('/a/b', '/a/x', '/a/x/y', '/a', '/a/'), ['HEAD', '/a/x'], ['OPTIONS', '/a/b'], ['POST', '/a/b']], +); + +const constraint = scenario( + 'H03-constraint', + 'constrained param beats plain param; constraint tested against the decoded segment', + [ + ['plain', 'GET', '/users/:value'], + ['digits', 'GET', '/users/:id(\\d+)'], + ], + get('/users/42', '/users/alice', '/users/42x', '/users/%34%32', '/users/'), +); + +const constraintTie = scenario( + 'H05-constraint-tie', + 'two overlapping constraints of equal rank: registration order decides', + [ + ['digits', 'GET', '/n/:num(\\d+)'], + ['hex', 'GET', '/n/:code([0-9a-f]+)'], + ], + get('/n/42', '/n/ff', '/n/4f', '/n/zz'), +); + +const equalRank = scenario( + 'H08-equal-rank', + 'equal-specificity plain params: first registered wins', + [ + ['first', 'GET', '/t/:first'], + ['second', 'GET', '/t/:second'], + ], + [...get('/t/x', '/t/x/y'), ['HEAD', '/t/x']], +); + +const samePattern = scenario( + 'H10-same-pattern', + 'identical pattern text under two declaration IDs (mesh local/remote twins reach the matcher this way)', + [ + ['one', 'GET', '/same'], + ['two', 'GET', '/same'], + ], + [...get('/same'), ['HEAD', '/same'], ['OPTIONS', '/same']], +); + +export const HAND_SCENARIOS: Scenario[] = [ + rank, + reversed(rank, 'H02-rank-reversed'), + constraint, + reversed(constraint, 'H04-constraint-reversed'), + constraintTie, + reversed(constraintTie, 'H06-constraint-tie-reversed'), + scenario( + 'H07-exact-vs-catch-all', + 'exact route at /files, catch-all below it, decoded captures', + [ + ['exact', 'GET', '/files'], + ['rest', 'GET', '/files/:rest*'], + ], + [...get('/files', '/files/', '/files/a%2Fb', '/files/a/b/c', '/files/a%20b/c%2Fd'), ['HEAD', '/files/x']], + ), + equalRank, + reversed(equalRank, 'H09-equal-rank-reversed'), + samePattern, + reversed(samePattern, 'H11-same-pattern-reversed'), + scenario( + 'H12-method-implicit-head', + 'buffered GET supplies HEAD; OPTIONS and 405 share one canonical Allow', + [ + ['get', 'GET', '/m'], + ['post', 'POST', '/m'], + ], + methods('/m', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'DELETE', 'PATCH'), + ), + scenario( + 'H13-method-explicit-head', + 'an explicit HEAD wins over the buffered-GET fallback', + [ + ['get', 'GET', '/m'], + ['post', 'POST', '/m'], + ['head', 'HEAD', '/m'], + ], + methods('/m', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'DELETE'), + ), + scenario( + 'H14-streaming-head', + 'a streaming GET does not supply HEAD', + [['stream', 'GET', '/stream', 'sse']], + methods('/stream', 'GET', 'HEAD', 'OPTIONS', 'POST'), + ), + scenario( + 'H15-streaming-outranks-buffered', + 'HEAD skips a higher-ranked streaming GET and falls back to a lower-ranked buffered GET', + [ + ['live', 'GET', '/s/live', 'sse'], + ['byId', 'GET', '/s/:id'], + ], + [...methods('/s/live', 'GET', 'HEAD', 'OPTIONS'), ['HEAD', '/s/x']], + ), + scenario( + 'H16-negotiate-and-ndjson-head', + 'negotiate and ndjson GETs are streaming transports for the HEAD rule', + [ + ['negotiate', 'GET', '/neg', 'negotiate'], + ['ndjson', 'GET', '/nd', 'ndjson'], + ], + [...methods('/neg', 'GET', 'HEAD', 'OPTIONS'), ...methods('/nd', 'HEAD', 'OPTIONS')], + ), + scenario( + 'H17-allow-order', + 'Allow is canonical regardless of declaration order; explicit OPTIONS is a normal route', + [ + ['delete', 'DELETE', '/r'], + ['patch', 'PATCH', '/r'], + ['options', 'OPTIONS', '/r'], + ['put', 'PUT', '/r'], + ['get', 'GET', '/r', 'sse'], + ['post', 'POST', '/r'], + ], + methods('/r', 'OPTIONS', 'HEAD', 'GET', 'TRACE', 'POST'), + ), + scenario( + 'H18-path-miss', + 'a path no pattern matches: no route and an empty Allow', + [['a', 'GET', '/a']], + [...get('/absent', '/a/extra', '/'), ['OPTIONS', '/absent'], ['HEAD', '/absent']], + ), + scenario( + 'H19-encoding-case-unicode', + 'decoded params, malformed escapes, repeated slashes, exact case and Unicode literals', + [ + ['userId', 'GET', '/users/:id'], + ['upper', 'GET', '/Case'], + ['unicode', 'GET', '/café'], + ['unicodeParam', 'GET', '/u/:name'], + ], + get( + '/users/a%20b', + '/users/a+b', + '/users/%F0%9F%8D%B5', + '/users/%E0%A4%A', + '/users/%zz', + '/a//b', + '/users//x', + '/Case', + '/case', + '/CASE', + '/café', + '/caf%C3%A9', + '/u/caf%C3%A9', + '/u/café', + ), + ), + scenario( + 'H20-normalization', + 'one trailing slash removed; plain and encoded dot segments resolved before lookup', + [ + ['a', 'GET', '/a'], + ['admin', 'GET', '/admin'], + ['file', 'GET', '/public/:file'], + ], + get( + '/a/', + '/a//', + '/public/../admin', + '/public/%2e%2e/admin', + '/public/%2E%2E/admin', + '/public/./x', + '/a/.', + '/public/..%2fadmin', + '/..', + '/a/b/../../admin', + '', + 'a', + ), + ), + scenario( + 'H21-root', + 'the root pattern and a root catch-all', + [ + ['any', 'GET', '/:rest*'], + ['root', 'GET', '/'], + ], + get('/', '/x', '/x/y', '/x/'), + ), + scenario( + 'H22-first-differing-segment', + 'ranking is decided at the first segment whose kind differs', + [ + ['paramStatic', 'GET', '/a/:x/c'], + ['staticParam', 'GET', '/a/b/:y'], + ['paramConstrained', 'GET', '/a/:x/:y(\\d+)'], + ], + get('/a/b/c', '/a/z/c', '/a/z/5', '/a/b/5', '/a/z/q'), + ), + scenario( + 'H23-per-position-decode', + 'a decoded value is the same for every candidate the scan reaches', + [ + ['zzz', 'GET', '/a/:x/zzz'], + ['b', 'GET', '/a/:y/b'], + ], + get('/a/a%20b/b', '/a/a%20b/zzz'), + ), + scenario( + 'H24-constrained-catch-all', + 'two catch-alls ranked by the segments before them', + [ + ['named', 'GET', '/v/:name/:rest*'], + ['versioned', 'GET', '/v/:ver(\\d+)/:rest*'], + ], + get('/v/1/x', '/v/a/x', '/v/1', '/v'), + ), +]; diff --git a/test/router-parity/frozen/app-fetch.json b/test/router-parity/frozen/app-fetch.json new file mode 100644 index 0000000..5cf4fa5 --- /dev/null +++ b/test/router-parity/frozen/app-fetch.json @@ -0,0 +1,597 @@ +{ + "revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a", + "data": [ + { + "method": "GET", + "raw": "/a/b", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"aB\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/a/x", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"aId\",\"params\":{\"id\":\"x\"}}" + }, + { + "method": "GET", + "raw": "/a/x/y", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"aRest\",\"params\":{\"rest\":\"x/y\"}}" + }, + { + "method": "GET", + "raw": "/a", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"aRest\",\"params\":{\"rest\":\"\"}}" + }, + { + "method": "GET", + "raw": "/users/42", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"usersId\",\"params\":{\"id\":\"42\"}}" + }, + { + "method": "GET", + "raw": "/users/alice", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"usersValue\",\"params\":{\"value\":\"alice\"}}" + }, + { + "method": "GET", + "raw": "/users/a%20b", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"usersValue\",\"params\":{\"value\":\"a b\"}}" + }, + { + "method": "GET", + "raw": "/n/42", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"nNum\",\"params\":{\"num\":\"42\"}}" + }, + { + "method": "GET", + "raw": "/n/ff", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"nCode\",\"params\":{\"code\":\"ff\"}}" + }, + { + "method": "GET", + "raw": "/files", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"files\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/files/", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"files\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/files/a%2Fb", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"filesRest\",\"params\":{\"rest\":\"a/b\"}}" + }, + { + "method": "GET", + "raw": "/m", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"mGet\",\"params\":{}}" + }, + { + "method": "HEAD", + "raw": "/m", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "OPTIONS", + "raw": "/m", + "status": 204, + "headers": { + "allow": "GET, HEAD, POST, OPTIONS", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "PUT", + "raw": "/m", + "status": 405, + "headers": { + "allow": "GET, HEAD, POST, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Method Not Allowed\"}" + }, + { + "method": "DELETE", + "raw": "/m", + "status": 405, + "headers": { + "allow": "GET, HEAD, POST, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Method Not Allowed\"}" + }, + { + "method": "POST", + "raw": "/m", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"mPost\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/h", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"hGet\",\"params\":{}}" + }, + { + "method": "HEAD", + "raw": "/h", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "GET", + "raw": "/stream", + "status": 200, + "headers": { + "cache-control": "no-cache", + "content-type": "text/event-stream", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "data: {\"id\":\"stream\"}\n\n" + }, + { + "method": "HEAD", + "raw": "/stream", + "status": 405, + "headers": { + "allow": "GET, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "OPTIONS", + "raw": "/stream", + "status": 204, + "headers": { + "allow": "GET, OPTIONS", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "HEAD", + "raw": "/s/live", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "HEAD", + "raw": "/s/x", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "GET", + "raw": "/absent", + "status": 404, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Not Found\"}" + }, + { + "method": "HEAD", + "raw": "/absent", + "status": 404, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "OPTIONS", + "raw": "/absent", + "status": 404, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Not Found\"}" + }, + { + "method": "GET", + "raw": "/users/%E0%A4%A", + "status": 400, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Bad Request\"}" + }, + { + "method": "HEAD", + "raw": "/users/%E0%A4%A", + "status": 400, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "GET", + "raw": "/a//b", + "status": 400, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Bad Request\"}" + }, + { + "method": "GET", + "raw": "/Case", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"caseUpper\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/case", + "status": 404, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Not Found\"}" + }, + { + "method": "GET", + "raw": "/caf%C3%A9", + "status": 404, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Not Found\"}" + }, + { + "method": "GET", + "raw": "/u/caf%C3%A9", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"uName\",\"params\":{\"name\":\"café\"}}" + }, + { + "method": "GET", + "raw": "/public/../admin", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"admin\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/public/%2e%2e/admin", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"admin\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/public/..%2fadmin", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"publicFile\",\"params\":{\"file\":\"../admin\"}}" + }, + { + "method": "GET", + "raw": "/admin/", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"admin\",\"params\":{}}" + }, + { + "method": "OPTIONS", + "raw": "/r", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"rOptions\",\"params\":{}}" + }, + { + "method": "HEAD", + "raw": "/r", + "status": 405, + "headers": { + "allow": "PUT, PATCH, DELETE, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "GET", + "raw": "/r", + "status": 405, + "headers": { + "allow": "PUT, PATCH, DELETE, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Method Not Allowed\"}" + }, + { + "method": "PURGE", + "raw": "/r", + "status": 405, + "headers": { + "allow": "PUT, PATCH, DELETE, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Method Not Allowed\"}" + }, + { + "method": "GET", + "raw": "/", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"root\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/?q=1", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"root\",\"params\":{}}" + } + ] +} diff --git a/test/router-parity/frozen/app-node.json b/test/router-parity/frozen/app-node.json new file mode 100644 index 0000000..9925087 --- /dev/null +++ b/test/router-parity/frozen/app-node.json @@ -0,0 +1,632 @@ +{ + "revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a", + "data": [ + { + "method": "GET", + "raw": "/a/b", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"aB\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/a/x", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"aId\",\"params\":{\"id\":\"x\"}}" + }, + { + "method": "GET", + "raw": "/a/x/y", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"aRest\",\"params\":{\"rest\":\"x/y\"}}" + }, + { + "method": "GET", + "raw": "/a", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"aRest\",\"params\":{\"rest\":\"\"}}" + }, + { + "method": "GET", + "raw": "/users/42", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"usersId\",\"params\":{\"id\":\"42\"}}" + }, + { + "method": "GET", + "raw": "/users/alice", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"usersValue\",\"params\":{\"value\":\"alice\"}}" + }, + { + "method": "GET", + "raw": "/users/a%20b", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"usersValue\",\"params\":{\"value\":\"a b\"}}" + }, + { + "method": "GET", + "raw": "/n/42", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"nNum\",\"params\":{\"num\":\"42\"}}" + }, + { + "method": "GET", + "raw": "/n/ff", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"nCode\",\"params\":{\"code\":\"ff\"}}" + }, + { + "method": "GET", + "raw": "/files", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"files\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/files/", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"files\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/files/a%2Fb", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"filesRest\",\"params\":{\"rest\":\"a/b\"}}" + }, + { + "method": "GET", + "raw": "/m", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"mGet\",\"params\":{}}" + }, + { + "method": "HEAD", + "raw": "/m", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "OPTIONS", + "raw": "/m", + "status": 204, + "headers": { + "allow": "GET, HEAD, POST, OPTIONS", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "PUT", + "raw": "/m", + "status": 405, + "headers": { + "allow": "GET, HEAD, POST, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Method Not Allowed\"}" + }, + { + "method": "DELETE", + "raw": "/m", + "status": 405, + "headers": { + "allow": "GET, HEAD, POST, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Method Not Allowed\"}" + }, + { + "method": "POST", + "raw": "/m", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"mPost\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/h", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"hGet\",\"params\":{}}" + }, + { + "method": "HEAD", + "raw": "/h", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "GET", + "raw": "/stream", + "status": 200, + "headers": { + "cache-control": "no-cache", + "content-type": "text/event-stream", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "data: {\"id\":\"stream\"}\n\n" + }, + { + "method": "HEAD", + "raw": "/stream", + "status": 405, + "headers": { + "allow": "GET, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "OPTIONS", + "raw": "/stream", + "status": 204, + "headers": { + "allow": "GET, OPTIONS", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "HEAD", + "raw": "/s/live", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "HEAD", + "raw": "/s/x", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "GET", + "raw": "/absent", + "status": 404, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Not Found\"}" + }, + { + "method": "HEAD", + "raw": "/absent", + "status": 404, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "OPTIONS", + "raw": "/absent", + "status": 404, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Not Found\"}" + }, + { + "method": "GET", + "raw": "/users/%E0%A4%A", + "status": 400, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Bad Request\"}" + }, + { + "method": "HEAD", + "raw": "/users/%E0%A4%A", + "status": 400, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "GET", + "raw": "/a//b", + "status": 400, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Bad Request\"}" + }, + { + "method": "GET", + "raw": "/Case", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"caseUpper\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/case", + "status": 404, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Not Found\"}" + }, + { + "method": "GET", + "raw": "/caf%C3%A9", + "status": 404, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Not Found\"}" + }, + { + "method": "GET", + "raw": "/u/caf%C3%A9", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"uName\",\"params\":{\"name\":\"café\"}}" + }, + { + "method": "GET", + "raw": "/public/../admin", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"admin\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/public/%2e%2e/admin", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"admin\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/public/..%2fadmin", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"publicFile\",\"params\":{\"file\":\"../admin\"}}" + }, + { + "method": "GET", + "raw": "/admin/", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"admin\",\"params\":{}}" + }, + { + "method": "OPTIONS", + "raw": "/r", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"rOptions\",\"params\":{}}" + }, + { + "method": "HEAD", + "raw": "/r", + "status": 405, + "headers": { + "allow": "PUT, PATCH, DELETE, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "" + }, + { + "method": "GET", + "raw": "/r", + "status": 405, + "headers": { + "allow": "PUT, PATCH, DELETE, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Method Not Allowed\"}" + }, + { + "method": "PURGE", + "raw": "/r", + "status": 405, + "headers": { + "allow": "PUT, PATCH, DELETE, OPTIONS", + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"error\":\"Method Not Allowed\"}" + }, + { + "method": "GET", + "raw": "/", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"root\",\"params\":{}}" + }, + { + "method": "GET", + "raw": "/?q=1", + "status": 200, + "headers": { + "content-type": "application/json", + "referrer-policy": "no-referrer", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-dns-prefetch-control": "off", + "x-frame-options": "SAMEORIGIN" + }, + "body": "{\"id\":\"root\",\"params\":{}}" + } + ] +} diff --git a/test/router-parity/frozen/boot-app.json b/test/router-parity/frozen/boot-app.json new file mode 100644 index 0000000..64d500d --- /dev/null +++ b/test/router-parity/frozen/boot-app.json @@ -0,0 +1,183 @@ +{ + "revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a", + "data": [ + { + "id": "B01-duplicate-param", + "declarations": [ + "@Get('/x/:id/:id')" + ], + "error": { + "name": "Error", + "message": "invalid route pattern '/x/:id/:id': duplicate parameter 'id'" + } + }, + { + "id": "B02-nonfinal-catch-all", + "declarations": [ + "@Get('/x/:rest*/tail')" + ], + "error": { + "name": "Error", + "message": "invalid route pattern '/x/:rest*/tail': catch-all must be the final segment" + } + }, + { + "id": "B03-nested-quantifier", + "declarations": [ + "@Get('/x/:id((a+)+)')" + ], + "error": { + "name": "Error", + "message": "unsafe route constraint: unsupported expression '(a+)+'" + } + }, + { + "id": "B04-alternation", + "declarations": [ + "@Get('/x/:id(a|b)')" + ], + "error": { + "name": "Error", + "message": "unsafe route constraint: unsupported expression 'a|b'" + } + }, + { + "id": "B05-adjacent-unbounded", + "declarations": [ + "@Get('/x/:id(\\d+\\w+)')" + ], + "error": { + "name": "Error", + "message": "unsafe route constraint: adjacent unbounded quantifiers in '\\d+\\w+'" + } + }, + { + "id": "B06-inverted-quantifier", + "declarations": [ + "@Get('/x/:id(\\d{5,2})')" + ], + "error": { + "name": "Error", + "message": "unsafe route constraint: invalid quantifier '{5,2}'" + } + }, + { + "id": "B07-invalid-param-name", + "declarations": [ + "@Get('/x/:1x')" + ], + "error": { + "name": "Error", + "message": "invalid route pattern '/x/:1x': invalid parameter name '1x'" + } + }, + { + "id": "B08-malformed-constraint", + "declarations": [ + "@Get('/x/:id(\\d+')" + ], + "error": { + "name": "Error", + "message": "invalid route pattern '/x/:id(\\d+': malformed constraint" + } + }, + { + "id": "B09-same-shape-plain", + "declarations": [ + "@Get('/users/:id')", + "@Get('/users/:name')" + ], + "error": { + "name": "Error", + "message": "ambiguous route GET /users/:name at ParityBoot.h1 conflicts with GET /users/:id at ParityBoot.h0" + } + }, + { + "id": "B10-same-shape-constrained", + "declarations": [ + "@Get('/c/:a(\\d+)')", + "@Get('/c/:b(\\d+)')" + ], + "error": { + "name": "Error", + "message": "ambiguous route GET /c/:b(\\d+) at ParityBoot.h1 conflicts with GET /c/:a(\\d+) at ParityBoot.h0" + } + }, + { + "id": "B11-trailing-slash-twin", + "declarations": [ + "@Get('/t')", + "@Get('/t/')" + ], + "error": { + "name": "Error", + "message": "ambiguous route GET /t/ at ParityBoot.h1 conflicts with GET /t at ParityBoot.h0" + } + }, + { + "id": "B12-get-and-ws-same-path", + "declarations": [ + "@Get('/live')", + "@Ws('/live')" + ], + "error": { + "name": "Error", + "message": "ambiguous route GET /live at ParityBoot.h1 conflicts with GET /live at ParityBoot.h0" + } + }, + { + "id": "B13-get-and-sse-same-path", + "declarations": [ + "@Get('/feed')", + "@Sse('/feed')" + ], + "error": { + "name": "Error", + "message": "ambiguous route GET /feed at ParityBoot.h1 conflicts with GET /feed at ParityBoot.h0" + } + }, + { + "id": "B14-ws-same-shape", + "declarations": [ + "@Ws('/w/:a')", + "@Ws('/w/:b')" + ], + "error": { + "name": "Error", + "message": "ambiguous route GET /w/:b at ParityBoot.h1 conflicts with GET /w/:a at ParityBoot.h0" + } + }, + { + "id": "B15-ok-same-shape-different-methods", + "declarations": [ + "@Get('/users/:id')", + "@Post('/users/:name')" + ], + "ok": true + }, + { + "id": "B16-ok-different-constraints", + "declarations": [ + "@Get('/c/:a(\\d+)')", + "@Get('/c/:b([a-z]+)')" + ], + "ok": true + }, + { + "id": "B17-ok-static-and-param", + "declarations": [ + "@Get('/users/me')", + "@Get('/users/:id')" + ], + "ok": true + }, + { + "id": "B18-ok-exact-and-catch-all", + "declarations": [ + "@Get('/f')", + "@Get('/f/:rest*')" + ], + "ok": true + } + ] +} diff --git a/test/router-parity/frozen/boot-mesh.json b/test/router-parity/frozen/boot-mesh.json new file mode 100644 index 0000000..a472708 --- /dev/null +++ b/test/router-parity/frozen/boot-mesh.json @@ -0,0 +1,72 @@ +{ + "revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a", + "data": [ + { + "id": "M01-two-teapots-same-route", + "error": { + "name": "Error", + "message": "mesh: ambiguous remote route 'GET /api/dup/ping' from conflicts with 'GET /api/dup/ping' from — load balancing across teapots is not implemented yet, so green-tea will not choose one for you. Export it from a single teapot." + } + }, + { + "id": "M02-two-teapots-same-shape", + "error": { + "name": "Error", + "message": "mesh: ambiguous remote route 'GET /api/shape/:name' from conflicts with 'GET /api/shape/:id' from — load balancing across teapots is not implemented yet, so green-tea will not choose one for you. Export it from a single teapot." + } + }, + { + "id": "M03-local-same-shape-wins", + "ok": true, + "warnings": [ + "mesh: route 'GET /api/dup/ping' is exported by teapot but also declared locally — the local route takes precedence and the remote one will not be reached. Remove one if that is not what you meant." + ], + "responses": [ + { + "path": "/api/dup/ping", + "status": 200, + "body": "{\"from\":\"local\"}" + } + ] + }, + { + "id": "M04-unique-remote", + "ok": true, + "warnings": [], + "responses": [ + { + "path": "/api/dup/ping", + "status": 200, + "body": "{\"from\":\"teapot\"}" + }, + { + "path": "/c/ok", + "status": 200, + "body": "{\"from\":\"teacup\"}" + }, + { + "path": "/api/nope", + "status": 404, + "body": "{\"error\":\"Not Found\"}" + } + ] + }, + { + "id": "M05-remote-static-outranks-local-param", + "ok": true, + "warnings": [], + "responses": [ + { + "path": "/api/dup/ping", + "status": 200, + "body": "{\"from\":\"teapot\"}" + }, + { + "path": "/api/dup/x", + "status": 200, + "body": "{\"from\":\"local\",\"p\":{\"anything\":\"x\"}}" + } + ] + } + ] +} diff --git a/test/router-parity/frozen/boot-patterns.json b/test/router-parity/frozen/boot-patterns.json new file mode 100644 index 0000000..aab64a4 --- /dev/null +++ b/test/router-parity/frozen/boot-patterns.json @@ -0,0 +1,163 @@ +{ + "revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a", + "data": [ + { + "pattern": "/", + "shape": "" + }, + { + "pattern": "/users/:id", + "shape": "s:users/p" + }, + { + "pattern": "/users/:id(\\d+)", + "shape": "s:users/r:\\d+" + }, + { + "pattern": "/files/:rest*", + "shape": "s:files/c" + }, + { + "pattern": "/:rest*", + "shape": "c" + }, + { + "pattern": "/t/", + "shape": "s:t" + }, + { + "pattern": "/café", + "shape": "s:café" + }, + { + "pattern": "/build/:version(\\d{2}\\.\\d{1,2})", + "shape": "s:build/r:\\d{2}\\.\\d{1,2}" + }, + { + "pattern": "/x/:id/:id", + "error": { + "name": "Error", + "message": "invalid route pattern '/x/:id/:id': duplicate parameter 'id'" + } + }, + { + "pattern": "/x/:id/:rest*/tail", + "error": { + "name": "Error", + "message": "invalid route pattern '/x/:id/:rest*/tail': catch-all must be the final segment" + } + }, + { + "pattern": "/x/:rest*/:rest*", + "error": { + "name": "Error", + "message": "invalid route pattern '/x/:rest*/:rest*': catch-all must be the final segment" + } + }, + { + "pattern": "/x/:", + "error": { + "name": "Error", + "message": "invalid route pattern '/x/:': invalid parameter name ''" + } + }, + { + "pattern": "/x/:1x", + "error": { + "name": "Error", + "message": "invalid route pattern '/x/:1x': invalid parameter name '1x'" + } + }, + { + "pattern": "/x//y", + "error": { + "name": "Error", + "message": "invalid route pattern '/x//y': repeated slash" + } + }, + { + "pattern": "x", + "error": { + "name": "Error", + "message": "invalid route pattern 'x': pattern must start with '/'" + } + }, + { + "pattern": "", + "error": { + "name": "Error", + "message": "invalid route pattern '': pattern must start with '/'" + } + }, + { + "pattern": "/x/:id((a+)+)", + "error": { + "name": "Error", + "message": "unsafe route constraint: unsupported expression '(a+)+'" + } + }, + { + "pattern": "/x/:id((?=a)a)", + "error": { + "name": "Error", + "message": "unsafe route constraint: unsupported expression '(?=a)a'" + } + }, + { + "pattern": "/x/:id(\\1)", + "error": { + "name": "Error", + "message": "unsafe route constraint: unsupported expression '\\1'" + } + }, + { + "pattern": "/x/:id(a|b)", + "error": { + "name": "Error", + "message": "unsafe route constraint: unsupported expression 'a|b'" + } + }, + { + "pattern": "/x/:id(\\d+\\w+)", + "error": { + "name": "Error", + "message": "unsafe route constraint: adjacent unbounded quantifiers in '\\d+\\w+'" + } + }, + { + "pattern": "/x/:id(\\d{5,2})", + "error": { + "name": "Error", + "message": "unsafe route constraint: invalid quantifier '{5,2}'" + } + }, + { + "pattern": "/x/:id(\\d{1,4096})", + "error": { + "name": "Error", + "message": "unsafe route constraint: invalid quantifier '{1,4096}'" + } + }, + { + "pattern": "/x/:id(\\d+", + "error": { + "name": "Error", + "message": "invalid route pattern '/x/:id(\\d+': malformed constraint" + } + }, + { + "pattern": "/x/:id()", + "error": { + "name": "Error", + "message": "unsafe route constraint: expression must contain 1-128 characters" + } + }, + { + "pattern": "/x/:id(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)", + "error": { + "name": "Error", + "message": "unsafe route constraint: expression must contain 1-128 characters" + } + } + ] +} diff --git a/test/router-parity/frozen/matcher-generated.json b/test/router-parity/frozen/matcher-generated.json new file mode 100644 index 0000000..9a6ede6 --- /dev/null +++ b/test/router-parity/frozen/matcher-generated.json @@ -0,0 +1,9742 @@ +{ + "revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a", + "data": { + "generator": "router-parity-gen-v1", + "seed": 10908, + "rules": [ + "PRNG: mulberry32(seed); every choice below draws from it in program order.", + "40 scenarios; each has 2-10 declarations and 12 requests.", + "Declaration: 0-3 segments, each static (a|b|c|x, p=0.5), plain param (p=0.25) or constrained param (p=0.25) using one of \\d+ | [a-c]+ | [0-9a-f]{2}; then a final catch-all with p=0.2. Param names are p.", + "Declaration method from GET x3, POST, PUT, DELETE, PATCH, HEAD, OPTIONS. A GET is buffer with p=0.7, else sse | ndjson | negotiate; every other method is buffer.", + "Request path: p=0.6 instantiate a random declaration (static -> its literal, param -> value pool, catch-all -> 0-2 pool values), else 0-4 random pool segments. Value pool: a b c x 7 42 ff 0a a%20b caf%C3%A9 %34%32.", + "Request decoration: trailing slash p=0.15, a dot segment (/./ or /q/../) inserted p=0.1, a repeated slash p=0.05.", + "Request method from GET x2, HEAD, POST, PUT, DELETE, PATCH, OPTIONS.", + "Unsupported patterns are never produced: every generated pattern must pass compilePattern." + ], + "scenarios": [ + { + "id": "G01", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G01.d1", + "method": "HEAD", + "pattern": "/:p0([0-9a-f]{2})/a/:p2([a-c]+)", + "transport": "buffer" + }, + { + "id": "G01.d2", + "method": "GET", + "pattern": "/c/x/c", + "transport": "buffer" + }, + { + "id": "G01.d3", + "method": "GET", + "pattern": "/b/x", + "transport": "buffer" + }, + { + "id": "G01.d4", + "method": "OPTIONS", + "pattern": "/:p0(\\d+)", + "transport": "buffer" + }, + { + "id": "G01.d5", + "method": "GET", + "pattern": "/:p0/:p1*", + "transport": "ndjson" + }, + { + "id": "G01.d6", + "method": "PUT", + "pattern": "/:p0(\\d+)/:p1", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "OPTIONS", + "raw": "/a" + }, + { + "method": "HEAD", + "raw": "/7/" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "/a/caf%C3%A9" + }, + { + "method": "OPTIONS", + "raw": "/ff/7" + }, + { + "method": "GET", + "raw": "/c/x/%34%32" + }, + { + "method": "OPTIONS", + "raw": "/b/x" + }, + { + "method": "GET", + "raw": "/caf%C3%A9" + }, + { + "method": "GET", + "raw": "/c" + }, + { + "method": "OPTIONS", + "raw": "/a%20b/a/c" + }, + { + "method": "OPTIONS", + "raw": "/x" + }, + { + "method": "OPTIONS", + "raw": "/b/%34%32/42" + } + ], + "outcomes": [ + { + "method": "OPTIONS", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/7/", + "normalized": "/7", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/a/caf%C3%A9", + "normalized": "/a/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/ff/7", + "normalized": "/ff/7", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/c/x/%34%32", + "normalized": "/c/x/%34%32", + "match": { + "id": "G01.d5", + "params": { + "p0": "c", + "p1": "x/42" + } + }, + "resolve": { + "id": "G01.d5", + "params": { + "p0": "c", + "p1": "x/42" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/b/x", + "normalized": "/b/x", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/caf%C3%A9", + "normalized": "/caf%C3%A9", + "match": { + "id": "G01.d5", + "params": { + "p0": "café", + "p1": "" + } + }, + "resolve": { + "id": "G01.d5", + "params": { + "p0": "café", + "p1": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/c", + "normalized": "/c", + "match": { + "id": "G01.d5", + "params": { + "p0": "c", + "p1": "" + } + }, + "resolve": { + "id": "G01.d5", + "params": { + "p0": "c", + "p1": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/a%20b/a/c", + "normalized": "/a%20b/a/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/b/%34%32/42", + "normalized": "/b/%34%32/42", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + } + ] + }, + { + "id": "G02", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G02.d1", + "method": "GET", + "pattern": "/:p0(\\d+)", + "transport": "buffer" + }, + { + "id": "G02.d2", + "method": "DELETE", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G02.d3", + "method": "GET", + "pattern": "/:p0([0-9a-f]{2})/:p1/a", + "transport": "buffer" + }, + { + "id": "G02.d4", + "method": "GET", + "pattern": "/:p0*", + "transport": "buffer" + }, + { + "id": "G02.d5", + "method": "GET", + "pattern": "/", + "transport": "sse" + }, + { + "id": "G02.d6", + "method": "GET", + "pattern": "/:p0([0-9a-f]{2})", + "transport": "buffer" + }, + { + "id": "G02.d7", + "method": "GET", + "pattern": "/:p0([a-c]+)/b/:p2([0-9a-f]{2})", + "transport": "buffer" + }, + { + "id": "G02.d8", + "method": "HEAD", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G02.d9", + "method": "GET", + "pattern": "/c/:p1*", + "transport": "buffer" + }, + { + "id": "G02.d10", + "method": "GET", + "pattern": "/x/b", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "PATCH", + "raw": "//c/42/7" + }, + { + "method": "DELETE", + "raw": "/0a/a%20b/a/" + }, + { + "method": "GET", + "raw": "/q/.." + }, + { + "method": "DELETE", + "raw": "/%34%32/a%20b/b" + }, + { + "method": "POST", + "raw": "/b/x" + }, + { + "method": "GET", + "raw": "/x/b" + }, + { + "method": "DELETE", + "raw": "/0a/" + }, + { + "method": "PATCH", + "raw": "/caf%C3%A9" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "DELETE", + "raw": "/c/b" + }, + { + "method": "HEAD", + "raw": "/x/b" + }, + { + "method": "OPTIONS", + "raw": "/caf%C3%A9" + } + ], + "outcomes": [ + { + "method": "PATCH", + "raw": "//c/42/7", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "DELETE", + "raw": "/0a/a%20b/a/", + "normalized": "/0a/a%20b/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/q/..", + "normalized": "/", + "match": { + "id": "G02.d5", + "params": {} + }, + "resolve": { + "id": "G02.d5", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/%34%32/a%20b/b", + "normalized": "/%34%32/a%20b/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/b/x", + "normalized": "/b/x", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x/b", + "normalized": "/x/b", + "match": { + "id": "G02.d10", + "params": {} + }, + "resolve": { + "id": "G02.d10", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/0a/", + "normalized": "/0a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/caf%C3%A9", + "normalized": "/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": { + "id": "G02.d8", + "params": {} + }, + "resolve": { + "id": "G02.d8", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/c/b", + "normalized": "/c/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/x/b", + "normalized": "/x/b", + "match": null, + "resolve": { + "id": "G02.d10", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/caf%C3%A9", + "normalized": "/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "G03", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G03.d1", + "method": "DELETE", + "pattern": "/b/:p1/:p2", + "transport": "buffer" + }, + { + "id": "G03.d2", + "method": "HEAD", + "pattern": "/:p0/b", + "transport": "buffer" + }, + { + "id": "G03.d3", + "method": "HEAD", + "pattern": "/:p0", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "POST", + "raw": "/b/0a/./c" + }, + { + "method": "OPTIONS", + "raw": "/x" + }, + { + "method": "HEAD", + "raw": "/0a/" + }, + { + "method": "HEAD", + "raw": "/b/x/7/" + }, + { + "method": "GET", + "raw": "/a%20b/a/ff" + }, + { + "method": "PATCH", + "raw": "/c" + }, + { + "method": "PATCH", + "raw": "/%34%32/q/.." + }, + { + "method": "GET", + "raw": "/a%20b/b" + }, + { + "method": "PUT", + "raw": "/ff/b/" + }, + { + "method": "PATCH", + "raw": "/0a/" + }, + { + "method": "HEAD", + "raw": "/ff/b" + }, + { + "method": "GET", + "raw": "/" + } + ], + "outcomes": [ + { + "method": "POST", + "raw": "/b/0a/./c", + "normalized": "/b/0a/c", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/0a/", + "normalized": "/0a", + "match": { + "id": "G03.d3", + "params": { + "p0": "0a" + } + }, + "resolve": { + "id": "G03.d3", + "params": { + "p0": "0a" + }, + "implicitHead": false + }, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/b/x/7/", + "normalized": "/b/x/7", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a%20b/a/ff", + "normalized": "/a%20b/a/ff", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/%34%32/q/..", + "normalized": "/%34%32", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a%20b/b", + "normalized": "/a%20b/b", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/ff/b/", + "normalized": "/ff/b", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/0a/", + "normalized": "/0a", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/ff/b", + "normalized": "/ff/b", + "match": { + "id": "G03.d2", + "params": { + "p0": "ff" + } + }, + "resolve": { + "id": "G03.d2", + "params": { + "p0": "ff" + }, + "implicitHead": false + }, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "G04", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G04.d1", + "method": "POST", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G04.d2", + "method": "OPTIONS", + "pattern": "/:p0([0-9a-f]{2})/:p1/:p2(\\d+)", + "transport": "buffer" + }, + { + "id": "G04.d3", + "method": "PUT", + "pattern": "/c", + "transport": "buffer" + }, + { + "id": "G04.d4", + "method": "PUT", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G04.d5", + "method": "POST", + "pattern": "/:p0([0-9a-f]{2})/a", + "transport": "buffer" + }, + { + "id": "G04.d6", + "method": "GET", + "pattern": "/:p0/:p1", + "transport": "ndjson" + } + ], + "requests": [ + { + "method": "OPTIONS", + "raw": "/caf%C3%A9/a/x" + }, + { + "method": "PATCH", + "raw": "/7/a%20b/b/%34%32" + }, + { + "method": "GET", + "raw": "/0a/7/7" + }, + { + "method": "OPTIONS", + "raw": "/caf%C3%A9/0a/a" + }, + { + "method": "HEAD", + "raw": "/ff/a" + }, + { + "method": "GET", + "raw": "/x/caf%C3%A9" + }, + { + "method": "HEAD", + "raw": "/caf%C3%A9/b" + }, + { + "method": "PUT", + "raw": "/a%20b" + }, + { + "method": "DELETE", + "raw": "/%34%32/0a/a" + }, + { + "method": "GET", + "raw": "/c/a%20b" + }, + { + "method": "OPTIONS", + "raw": "/0a" + }, + { + "method": "HEAD", + "raw": "/7/0a" + } + ], + "outcomes": [ + { + "method": "OPTIONS", + "raw": "/caf%C3%A9/a/x", + "normalized": "/caf%C3%A9/a/x", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/7/a%20b/b/%34%32", + "normalized": "/7/a%20b/b/%34%32", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/0a/7/7", + "normalized": "/0a/7/7", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/caf%C3%A9/0a/a", + "normalized": "/caf%C3%A9/0a/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/ff/a", + "normalized": "/ff/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x/caf%C3%A9", + "normalized": "/x/caf%C3%A9", + "match": { + "id": "G04.d6", + "params": { + "p0": "x", + "p1": "café" + } + }, + "resolve": { + "id": "G04.d6", + "params": { + "p0": "x", + "p1": "café" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/caf%C3%A9/b", + "normalized": "/caf%C3%A9/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/a%20b", + "normalized": "/a%20b", + "match": { + "id": "G04.d4", + "params": { + "p0": "a b" + } + }, + "resolve": { + "id": "G04.d4", + "params": { + "p0": "a b" + }, + "implicitHead": false + }, + "allow": [ + "PUT", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/%34%32/0a/a", + "normalized": "/%34%32/0a/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/c/a%20b", + "normalized": "/c/a%20b", + "match": { + "id": "G04.d6", + "params": { + "p0": "c", + "p1": "a b" + } + }, + "resolve": { + "id": "G04.d6", + "params": { + "p0": "c", + "p1": "a b" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/0a", + "normalized": "/0a", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/7/0a", + "normalized": "/7/0a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + } + ] + }, + { + "id": "G05", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G05.d1", + "method": "PATCH", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G05.d2", + "method": "PATCH", + "pattern": "/a/:p1*", + "transport": "buffer" + }, + { + "id": "G05.d3", + "method": "GET", + "pattern": "/b/a/:p2([a-c]+)", + "transport": "buffer" + }, + { + "id": "G05.d4", + "method": "OPTIONS", + "pattern": "/:p0/:p1", + "transport": "buffer" + }, + { + "id": "G05.d5", + "method": "GET", + "pattern": "/c/b", + "transport": "buffer" + }, + { + "id": "G05.d6", + "method": "GET", + "pattern": "/a/a/:p2*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "OPTIONS", + "raw": "/c/b/ff/a%20b" + }, + { + "method": "PUT", + "raw": "/a/0a" + }, + { + "method": "PUT", + "raw": "/" + }, + { + "method": "GET", + "raw": "/x/7" + }, + { + "method": "OPTIONS", + "raw": "/b/a/ff" + }, + { + "method": "PATCH", + "raw": "/b/c" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "GET", + "raw": "/a" + }, + { + "method": "OPTIONS", + "raw": "/ff/a%20b/c/0a" + }, + { + "method": "PATCH", + "raw": "/c/b/" + }, + { + "method": "PATCH", + "raw": "/a/a/0a/ff" + }, + { + "method": "GET", + "raw": "/q/.." + } + ], + "outcomes": [ + { + "method": "OPTIONS", + "raw": "/c/b/ff/a%20b", + "normalized": "/c/b/ff/a%20b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PUT", + "raw": "/a/0a", + "normalized": "/a/0a", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x/7", + "normalized": "/x/7", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/b/a/ff", + "normalized": "/b/a/ff", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/b/c", + "normalized": "/b/c", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/ff/a%20b/c/0a", + "normalized": "/ff/a%20b/c/0a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/c/b/", + "normalized": "/c/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/a/a/0a/ff", + "normalized": "/a/a/0a/ff", + "match": { + "id": "G05.d2", + "params": { + "p1": "a/0a/ff" + } + }, + "resolve": { + "id": "G05.d2", + "params": { + "p1": "a/0a/ff" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/q/..", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + } + ] + }, + { + "id": "G06", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G06.d1", + "method": "PATCH", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G06.d2", + "method": "GET", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G06.d3", + "method": "POST", + "pattern": "/a", + "transport": "buffer" + }, + { + "id": "G06.d4", + "method": "GET", + "pattern": "/x/:p1/:p2(\\d+)", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/q/.." + }, + { + "method": "OPTIONS", + "raw": "/" + }, + { + "method": "GET", + "raw": "/caf%C3%A9" + }, + { + "method": "PATCH", + "raw": "/a" + }, + { + "method": "OPTIONS", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "DELETE", + "raw": "//q/../a" + }, + { + "method": "HEAD", + "raw": "/q/.." + }, + { + "method": "DELETE", + "raw": "/a" + }, + { + "method": "POST", + "raw": "/a" + }, + { + "method": "DELETE", + "raw": "/a%20b/x" + }, + { + "method": "DELETE", + "raw": "/ff" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/q/..", + "normalized": "/", + "match": { + "id": "G06.d2", + "params": {} + }, + "resolve": { + "id": "G06.d2", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/caf%C3%A9", + "normalized": "/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "POST", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": { + "id": "G06.d2", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "//q/../a", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "HEAD", + "raw": "/q/..", + "normalized": "/", + "match": null, + "resolve": { + "id": "G06.d2", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "POST", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/a", + "normalized": "/a", + "match": { + "id": "G06.d3", + "params": {} + }, + "resolve": { + "id": "G06.d3", + "params": {}, + "implicitHead": false + }, + "allow": [ + "POST", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/a%20b/x", + "normalized": "/a%20b/x", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/ff", + "normalized": "/ff", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "G07", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G07.d1", + "method": "DELETE", + "pattern": "/:p0/:p1*", + "transport": "buffer" + }, + { + "id": "G07.d2", + "method": "OPTIONS", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G07.d3", + "method": "DELETE", + "pattern": "/a", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "DELETE", + "raw": "/a/." + }, + { + "method": "PUT", + "raw": "/a" + }, + { + "method": "DELETE", + "raw": "/c/a%20b/caf%C3%A9/ff" + }, + { + "method": "HEAD", + "raw": "/x/0a" + }, + { + "method": "DELETE", + "raw": "/q/../caf%C3%A9" + }, + { + "method": "PUT", + "raw": "/ff/42" + }, + { + "method": "HEAD", + "raw": "//c/caf%C3%A9/./0a/a%20b" + }, + { + "method": "PUT", + "raw": "/a/" + }, + { + "method": "GET", + "raw": "/a%20b" + }, + { + "method": "PUT", + "raw": "/." + }, + { + "method": "DELETE", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "/ff/42" + } + ], + "outcomes": [ + { + "method": "DELETE", + "raw": "/a/.", + "normalized": "/a", + "match": { + "id": "G07.d3", + "params": {} + }, + "resolve": { + "id": "G07.d3", + "params": {}, + "implicitHead": false + }, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/c/a%20b/caf%C3%A9/ff", + "normalized": "/c/a%20b/caf%C3%A9/ff", + "match": { + "id": "G07.d1", + "params": { + "p0": "c", + "p1": "a b/café/ff" + } + }, + "resolve": { + "id": "G07.d1", + "params": { + "p0": "c", + "p1": "a b/café/ff" + }, + "implicitHead": false + }, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/x/0a", + "normalized": "/x/0a", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/q/../caf%C3%A9", + "normalized": "/caf%C3%A9", + "match": { + "id": "G07.d1", + "params": { + "p0": "café", + "p1": "" + } + }, + "resolve": { + "id": "G07.d1", + "params": { + "p0": "café", + "p1": "" + }, + "implicitHead": false + }, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/ff/42", + "normalized": "/ff/42", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "//c/caf%C3%A9/./0a/a%20b", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "PUT", + "raw": "/a/", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a%20b", + "normalized": "/a%20b", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/.", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/ff/42", + "normalized": "/ff/42", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + } + ] + }, + { + "id": "G08", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G08.d1", + "method": "DELETE", + "pattern": "/:p0/:p1", + "transport": "buffer" + }, + { + "id": "G08.d2", + "method": "HEAD", + "pattern": "/c/:p1", + "transport": "buffer" + }, + { + "id": "G08.d3", + "method": "GET", + "pattern": "/c/c/:p2([0-9a-f]{2})", + "transport": "buffer" + }, + { + "id": "G08.d4", + "method": "GET", + "pattern": "/b", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "OPTIONS", + "raw": "/c/b" + }, + { + "method": "OPTIONS", + "raw": "/b" + }, + { + "method": "PATCH", + "raw": "/c/c/./a%20b" + }, + { + "method": "PATCH", + "raw": "/q/../0a/0a" + }, + { + "method": "GET", + "raw": "/c/c" + }, + { + "method": "OPTIONS", + "raw": "/7/caf%C3%A9" + }, + { + "method": "POST", + "raw": "/a/%34%32/b/caf%C3%A9" + }, + { + "method": "PATCH", + "raw": "/ff/0a/%34%32/x/" + }, + { + "method": "DELETE", + "raw": "/7/42/b" + }, + { + "method": "DELETE", + "raw": "/x/c/" + }, + { + "method": "OPTIONS", + "raw": "/7/caf%C3%A9" + }, + { + "method": "PUT", + "raw": "/c/c/b/" + } + ], + "outcomes": [ + { + "method": "OPTIONS", + "raw": "/c/b", + "normalized": "/c/b", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/b", + "normalized": "/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/c/c/./a%20b", + "normalized": "/c/c/a%20b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/q/../0a/0a", + "normalized": "/0a/0a", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/c/c", + "normalized": "/c/c", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/7/caf%C3%A9", + "normalized": "/7/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/a/%34%32/b/caf%C3%A9", + "normalized": "/a/%34%32/b/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/ff/0a/%34%32/x/", + "normalized": "/ff/0a/%34%32/x", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/7/42/b", + "normalized": "/7/42/b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/x/c/", + "normalized": "/x/c", + "match": { + "id": "G08.d1", + "params": { + "p0": "x", + "p1": "c" + } + }, + "resolve": { + "id": "G08.d1", + "params": { + "p0": "x", + "p1": "c" + }, + "implicitHead": false + }, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/7/caf%C3%A9", + "normalized": "/7/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/c/c/b/", + "normalized": "/c/c/b", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "G09", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G09.d1", + "method": "PUT", + "pattern": "/x/:p1/:p2", + "transport": "buffer" + }, + { + "id": "G09.d2", + "method": "PATCH", + "pattern": "/:p0/:p1", + "transport": "buffer" + }, + { + "id": "G09.d3", + "method": "POST", + "pattern": "/:p0([a-c]+)", + "transport": "buffer" + }, + { + "id": "G09.d4", + "method": "GET", + "pattern": "/:p0([a-c]+)/:p1", + "transport": "buffer" + }, + { + "id": "G09.d5", + "method": "GET", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G09.d6", + "method": "OPTIONS", + "pattern": "/a", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "DELETE", + "raw": "/a" + }, + { + "method": "OPTIONS", + "raw": "/" + }, + { + "method": "GET", + "raw": "/7" + }, + { + "method": "HEAD", + "raw": "/c/." + }, + { + "method": "GET", + "raw": "/x/a%20b/42" + }, + { + "method": "PUT", + "raw": "/a" + }, + { + "method": "DELETE", + "raw": "/q/.." + }, + { + "method": "OPTIONS", + "raw": "/a%20b" + }, + { + "method": "HEAD", + "raw": "/c/b/caf%C3%A9/caf%C3%A9" + }, + { + "method": "HEAD", + "raw": "/x" + }, + { + "method": "HEAD", + "raw": "/a/7/0a" + }, + { + "method": "GET", + "raw": "/" + } + ], + "outcomes": [ + { + "method": "DELETE", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/7", + "normalized": "/7", + "match": { + "id": "G09.d5", + "params": { + "p0": "7" + } + }, + "resolve": { + "id": "G09.d5", + "params": { + "p0": "7" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/c/.", + "normalized": "/c", + "match": null, + "resolve": { + "id": "G09.d5", + "params": { + "p0": "c" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x/a%20b/42", + "normalized": "/x/a%20b/42", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/q/..", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "OPTIONS", + "raw": "/a%20b", + "normalized": "/a%20b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/c/b/caf%C3%A9/caf%C3%A9", + "normalized": "/c/b/caf%C3%A9/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": { + "id": "G09.d5", + "params": { + "p0": "x" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/a/7/0a", + "normalized": "/a/7/0a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "G10", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G10.d1", + "method": "GET", + "pattern": "/:p0([0-9a-f]{2})/c/:p2*", + "transport": "buffer" + }, + { + "id": "G10.d2", + "method": "HEAD", + "pattern": "/b/:p1([a-c]+)/:p2([a-c]+)", + "transport": "buffer" + }, + { + "id": "G10.d3", + "method": "DELETE", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G10.d4", + "method": "GET", + "pattern": "/:p0/:p1*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "PUT", + "raw": "//b/ff/q/../c" + }, + { + "method": "GET", + "raw": "/x/a%20b/ff" + }, + { + "method": "OPTIONS", + "raw": "/q/.." + }, + { + "method": "OPTIONS", + "raw": "/b/42/a%20b" + }, + { + "method": "GET", + "raw": "/7/c/0a" + }, + { + "method": "POST", + "raw": "/%34%32/a%20b/7/42" + }, + { + "method": "GET", + "raw": "/b/a%20b/b" + }, + { + "method": "OPTIONS", + "raw": "/b/7/ff/" + }, + { + "method": "HEAD", + "raw": "/a%20b/c" + }, + { + "method": "GET", + "raw": "/7/b/c/" + }, + { + "method": "GET", + "raw": "/%34%32/" + }, + { + "method": "OPTIONS", + "raw": "/a/%34%32/a/a" + } + ], + "outcomes": [ + { + "method": "PUT", + "raw": "//b/ff/q/../c", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "GET", + "raw": "/x/a%20b/ff", + "normalized": "/x/a%20b/ff", + "match": { + "id": "G10.d4", + "params": { + "p0": "x", + "p1": "a b/ff" + } + }, + "resolve": { + "id": "G10.d4", + "params": { + "p0": "x", + "p1": "a b/ff" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/q/..", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/b/42/a%20b", + "normalized": "/b/42/a%20b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/7/c/0a", + "normalized": "/7/c/0a", + "match": { + "id": "G10.d4", + "params": { + "p0": "7", + "p1": "c/0a" + } + }, + "resolve": { + "id": "G10.d4", + "params": { + "p0": "7", + "p1": "c/0a" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/%34%32/a%20b/7/42", + "normalized": "/%34%32/a%20b/7/42", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/b/a%20b/b", + "normalized": "/b/a%20b/b", + "match": { + "id": "G10.d4", + "params": { + "p0": "b", + "p1": "a b/b" + } + }, + "resolve": { + "id": "G10.d4", + "params": { + "p0": "b", + "p1": "a b/b" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/b/7/ff/", + "normalized": "/b/7/ff", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/a%20b/c", + "normalized": "/a%20b/c", + "match": null, + "resolve": { + "id": "G10.d4", + "params": { + "p0": "a b", + "p1": "c" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/7/b/c/", + "normalized": "/7/b/c", + "match": { + "id": "G10.d4", + "params": { + "p0": "7", + "p1": "b/c" + } + }, + "resolve": { + "id": "G10.d4", + "params": { + "p0": "7", + "p1": "b/c" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/%34%32/", + "normalized": "/%34%32", + "match": { + "id": "G10.d4", + "params": { + "p0": "42", + "p1": "" + } + }, + "resolve": { + "id": "G10.d4", + "params": { + "p0": "42", + "p1": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/a/%34%32/a/a", + "normalized": "/a/%34%32/a/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "G11", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G11.d1", + "method": "DELETE", + "pattern": "/c", + "transport": "buffer" + }, + { + "id": "G11.d2", + "method": "HEAD", + "pattern": "/", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "POST", + "raw": "/" + }, + { + "method": "DELETE", + "raw": "/c/42" + }, + { + "method": "DELETE", + "raw": "/" + }, + { + "method": "POST", + "raw": "/c/" + }, + { + "method": "HEAD", + "raw": "/a/c/a%20b/" + }, + { + "method": "OPTIONS", + "raw": "/c" + }, + { + "method": "DELETE", + "raw": "/" + }, + { + "method": "POST", + "raw": "/" + }, + { + "method": "DELETE", + "raw": "/" + }, + { + "method": "POST", + "raw": "/" + }, + { + "method": "POST", + "raw": "/" + }, + { + "method": "POST", + "raw": "/%34%32" + } + ], + "outcomes": [ + { + "method": "POST", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/c/42", + "normalized": "/c/42", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/c/", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/a/c/a%20b/", + "normalized": "/a/c/a%20b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "OPTIONS", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/%34%32", + "normalized": "/%34%32", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "G12", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G12.d1", + "method": "PUT", + "pattern": "/c/c/c", + "transport": "buffer" + }, + { + "id": "G12.d2", + "method": "GET", + "pattern": "/:p0([0-9a-f]{2})", + "transport": "sse" + }, + { + "id": "G12.d3", + "method": "POST", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G12.d4", + "method": "OPTIONS", + "pattern": "/x/a", + "transport": "buffer" + }, + { + "id": "G12.d5", + "method": "POST", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G12.d6", + "method": "DELETE", + "pattern": "/c/c", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "DELETE", + "raw": "/b/a%20b" + }, + { + "method": "PUT", + "raw": "/" + }, + { + "method": "PUT", + "raw": "/" + }, + { + "method": "GET", + "raw": "/a" + }, + { + "method": "GET", + "raw": "/c/c/c" + }, + { + "method": "HEAD", + "raw": "/42" + }, + { + "method": "POST", + "raw": "/a%20b/caf%C3%A9/x" + }, + { + "method": "PUT", + "raw": "/c/c" + }, + { + "method": "PATCH", + "raw": "//x/a" + }, + { + "method": "GET", + "raw": "/ff" + }, + { + "method": "PUT", + "raw": "/7" + }, + { + "method": "PATCH", + "raw": "/x/42/" + } + ], + "outcomes": [ + { + "method": "DELETE", + "raw": "/b/a%20b", + "normalized": "/b/a%20b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PUT", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "POST", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/c/c/c", + "normalized": "/c/c/c", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/42", + "normalized": "/42", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/a%20b/caf%C3%A9/x", + "normalized": "/a%20b/caf%C3%A9/x", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PUT", + "raw": "/c/c", + "normalized": "/c/c", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "//x/a", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "GET", + "raw": "/ff", + "normalized": "/ff", + "match": { + "id": "G12.d2", + "params": { + "p0": "ff" + } + }, + "resolve": { + "id": "G12.d2", + "params": { + "p0": "ff" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/7", + "normalized": "/7", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/x/42/", + "normalized": "/x/42", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "G13", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G13.d1", + "method": "DELETE", + "pattern": "/x/c", + "transport": "buffer" + }, + { + "id": "G13.d2", + "method": "PATCH", + "pattern": "/:p0([a-c]+)/a", + "transport": "buffer" + }, + { + "id": "G13.d3", + "method": "OPTIONS", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G13.d4", + "method": "GET", + "pattern": "/:p0*", + "transport": "ndjson" + }, + { + "id": "G13.d5", + "method": "HEAD", + "pattern": "/", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "HEAD", + "raw": "/0a" + }, + { + "method": "GET", + "raw": "/caf%C3%A9/c" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "PUT", + "raw": "/q/../caf%C3%A9" + }, + { + "method": "GET", + "raw": "/a/a" + }, + { + "method": "PATCH", + "raw": "/" + }, + { + "method": "PUT", + "raw": "//x/c" + }, + { + "method": "OPTIONS", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "PATCH", + "raw": "/." + } + ], + "outcomes": [ + { + "method": "HEAD", + "raw": "/0a", + "normalized": "/0a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/caf%C3%A9/c", + "normalized": "/caf%C3%A9/c", + "match": { + "id": "G13.d4", + "params": { + "p0": "café/c" + } + }, + "resolve": { + "id": "G13.d4", + "params": { + "p0": "café/c" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": { + "id": "G13.d5", + "params": {} + }, + "resolve": { + "id": "G13.d5", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": { + "id": "G13.d5", + "params": {} + }, + "resolve": { + "id": "G13.d5", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G13.d4", + "params": { + "p0": "" + } + }, + "resolve": { + "id": "G13.d4", + "params": { + "p0": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/q/../caf%C3%A9", + "normalized": "/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/a", + "normalized": "/a/a", + "match": { + "id": "G13.d4", + "params": { + "p0": "a/a" + } + }, + "resolve": { + "id": "G13.d4", + "params": { + "p0": "a/a" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "//x/c", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "OPTIONS", + "raw": "/", + "normalized": "/", + "match": { + "id": "G13.d3", + "params": {} + }, + "resolve": { + "id": "G13.d3", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": { + "id": "G13.d5", + "params": {} + }, + "resolve": { + "id": "G13.d5", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/.", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "G14", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G14.d1", + "method": "PATCH", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G14.d2", + "method": "PATCH", + "pattern": "/b/:p1/:p2([0-9a-f]{2})", + "transport": "buffer" + }, + { + "id": "G14.d3", + "method": "PUT", + "pattern": "/x/c", + "transport": "buffer" + }, + { + "id": "G14.d4", + "method": "GET", + "pattern": "/x/:p1/:p2", + "transport": "buffer" + }, + { + "id": "G14.d5", + "method": "PUT", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G14.d6", + "method": "PATCH", + "pattern": "/", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "PUT", + "raw": "/b/ff/b/" + }, + { + "method": "OPTIONS", + "raw": "//" + }, + { + "method": "DELETE", + "raw": "/ff/a%20b/a%20b" + }, + { + "method": "PUT", + "raw": "/b/ff/7/" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "PUT", + "raw": "/x/b/ff" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "GET", + "raw": "/caf%C3%A9/c/a" + }, + { + "method": "GET", + "raw": "/x/c" + }, + { + "method": "POST", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "/x/caf%C3%A9/x" + } + ], + "outcomes": [ + { + "method": "PUT", + "raw": "/b/ff/b/", + "normalized": "/b/ff/b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "OPTIONS", + "raw": "//", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "DELETE", + "raw": "/ff/a%20b/a%20b", + "normalized": "/ff/a%20b/a%20b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PUT", + "raw": "/b/ff/7/", + "normalized": "/b/ff/7", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/x/b/ff", + "normalized": "/x/b/ff", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/caf%C3%A9/c/a", + "normalized": "/caf%C3%A9/c/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/x/c", + "normalized": "/x/c", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/x/caf%C3%A9/x", + "normalized": "/x/caf%C3%A9/x", + "match": null, + "resolve": { + "id": "G14.d4", + "params": { + "p1": "café", + "p2": "x" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "G15", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G15.d1", + "method": "GET", + "pattern": "/x/x/:p2", + "transport": "buffer" + }, + { + "id": "G15.d2", + "method": "OPTIONS", + "pattern": "/c/:p1([a-c]+)/:p2(\\d+)", + "transport": "buffer" + }, + { + "id": "G15.d3", + "method": "POST", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G15.d4", + "method": "GET", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G15.d5", + "method": "GET", + "pattern": "/:p0(\\d+)/:p1*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "PATCH", + "raw": "/" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "//c/42/caf%C3%A9/" + }, + { + "method": "DELETE", + "raw": "/c/" + }, + { + "method": "PATCH", + "raw": "/a%20b/q/.." + }, + { + "method": "PUT", + "raw": "/c/b/%34%32/" + }, + { + "method": "DELETE", + "raw": "/%34%32/b/a/." + }, + { + "method": "PATCH", + "raw": "/x/x/a/" + }, + { + "method": "OPTIONS", + "raw": "/c/7/a/" + }, + { + "method": "PUT", + "raw": "/%34%32/42/7/b" + }, + { + "method": "DELETE", + "raw": "/x/x/c" + }, + { + "method": "PUT", + "raw": "/a%20b/%34%32/" + } + ], + "outcomes": [ + { + "method": "PATCH", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G15.d4", + "params": {} + }, + "resolve": { + "id": "G15.d4", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "//c/42/caf%C3%A9/", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "DELETE", + "raw": "/c/", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/a%20b/q/..", + "normalized": "/a%20b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PUT", + "raw": "/c/b/%34%32/", + "normalized": "/c/b/%34%32", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/%34%32/b/a/.", + "normalized": "/%34%32/b/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/x/x/a/", + "normalized": "/x/x/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/c/7/a/", + "normalized": "/c/7/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PUT", + "raw": "/%34%32/42/7/b", + "normalized": "/%34%32/42/7/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/x/x/c", + "normalized": "/x/x/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/a%20b/%34%32/", + "normalized": "/a%20b/%34%32", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "G16", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G16.d1", + "method": "POST", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G16.d2", + "method": "GET", + "pattern": "/b", + "transport": "buffer" + }, + { + "id": "G16.d3", + "method": "HEAD", + "pattern": "/:p0*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/a%20b" + }, + { + "method": "POST", + "raw": "/ff/x" + }, + { + "method": "PUT", + "raw": "/7/" + }, + { + "method": "DELETE", + "raw": "/b/q/.." + }, + { + "method": "GET", + "raw": "/%34%32" + }, + { + "method": "GET", + "raw": "/b" + }, + { + "method": "POST", + "raw": "/ff/ff" + }, + { + "method": "OPTIONS", + "raw": "/ff" + }, + { + "method": "DELETE", + "raw": "/a" + }, + { + "method": "PUT", + "raw": "//ff" + }, + { + "method": "GET", + "raw": "/c/ff/7/" + }, + { + "method": "GET", + "raw": "/%34%32/b/a%20b/" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/a%20b", + "normalized": "/a%20b", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/ff/x", + "normalized": "/ff/x", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/7/", + "normalized": "/7", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/b/q/..", + "normalized": "/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/%34%32", + "normalized": "/%34%32", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/b", + "normalized": "/b", + "match": { + "id": "G16.d2", + "params": {} + }, + "resolve": { + "id": "G16.d2", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/ff/ff", + "normalized": "/ff/ff", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/ff", + "normalized": "/ff", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "//ff", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "GET", + "raw": "/c/ff/7/", + "normalized": "/c/ff/7", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/%34%32/b/a%20b/", + "normalized": "/%34%32/b/a%20b", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "G17", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G17.d1", + "method": "PATCH", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G17.d2", + "method": "GET", + "pattern": "/:p0(\\d+)/:p1/:p2(\\d+)", + "transport": "buffer" + }, + { + "id": "G17.d3", + "method": "HEAD", + "pattern": "/c", + "transport": "buffer" + }, + { + "id": "G17.d4", + "method": "PATCH", + "pattern": "/b/:p1/:p2", + "transport": "buffer" + }, + { + "id": "G17.d5", + "method": "GET", + "pattern": "/c", + "transport": "negotiate" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/ff/" + }, + { + "method": "GET", + "raw": "/c" + }, + { + "method": "HEAD", + "raw": "/x/" + }, + { + "method": "PATCH", + "raw": "/b/ff/42" + }, + { + "method": "DELETE", + "raw": "/caf%C3%A9/a%20b/%34%32/q/../%34%32" + }, + { + "method": "DELETE", + "raw": "/c/" + }, + { + "method": "POST", + "raw": "/b/0a/0a/" + }, + { + "method": "GET", + "raw": "/42/%34%32/ff/ff/" + }, + { + "method": "GET", + "raw": "/x" + }, + { + "method": "OPTIONS", + "raw": "/c" + }, + { + "method": "OPTIONS", + "raw": "/caf%C3%A9/x/42" + }, + { + "method": "HEAD", + "raw": "/c" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/ff/", + "normalized": "/ff", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/c", + "normalized": "/c", + "match": { + "id": "G17.d5", + "params": {} + }, + "resolve": { + "id": "G17.d5", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/x/", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/b/ff/42", + "normalized": "/b/ff/42", + "match": { + "id": "G17.d4", + "params": { + "p1": "ff", + "p2": "42" + } + }, + "resolve": { + "id": "G17.d4", + "params": { + "p1": "ff", + "p2": "42" + }, + "implicitHead": false + }, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/caf%C3%A9/a%20b/%34%32/q/../%34%32", + "normalized": "/caf%C3%A9/a%20b/%34%32/%34%32", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/c/", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/b/0a/0a/", + "normalized": "/b/0a/0a", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/42/%34%32/ff/ff/", + "normalized": "/42/%34%32/ff/ff", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/caf%C3%A9/x/42", + "normalized": "/caf%C3%A9/x/42", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/c", + "normalized": "/c", + "match": { + "id": "G17.d3", + "params": {} + }, + "resolve": { + "id": "G17.d3", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + } + ] + }, + { + "id": "G18", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G18.d1", + "method": "PUT", + "pattern": "/:p0([a-c]+)", + "transport": "buffer" + }, + { + "id": "G18.d2", + "method": "POST", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G18.d3", + "method": "PATCH", + "pattern": "/:p0/a", + "transport": "buffer" + }, + { + "id": "G18.d4", + "method": "DELETE", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G18.d5", + "method": "GET", + "pattern": "/x/a", + "transport": "buffer" + }, + { + "id": "G18.d6", + "method": "HEAD", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G18.d7", + "method": "GET", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G18.d8", + "method": "POST", + "pattern": "/:p0*", + "transport": "buffer" + }, + { + "id": "G18.d9", + "method": "HEAD", + "pattern": "/:p0*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "POST", + "raw": "/7" + }, + { + "method": "GET", + "raw": "/7/7/" + }, + { + "method": "GET", + "raw": "/a%20b/a/q/.." + }, + { + "method": "OPTIONS", + "raw": "/a/ff/b/c" + }, + { + "method": "OPTIONS", + "raw": "/42/a" + }, + { + "method": "GET", + "raw": "/ff" + }, + { + "method": "GET", + "raw": "/c/a%20b" + }, + { + "method": "PATCH", + "raw": "/a/q/.." + }, + { + "method": "POST", + "raw": "/7/7/a/x" + }, + { + "method": "DELETE", + "raw": "/" + }, + { + "method": "POST", + "raw": "/a" + }, + { + "method": "DELETE", + "raw": "/x/a" + } + ], + "outcomes": [ + { + "method": "POST", + "raw": "/7", + "normalized": "/7", + "match": { + "id": "G18.d2", + "params": { + "p0": "7" + } + }, + "resolve": { + "id": "G18.d2", + "params": { + "p0": "7" + }, + "implicitHead": false + }, + "allow": [ + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/7/7/", + "normalized": "/7/7", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a%20b/a/q/..", + "normalized": "/a%20b/a", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/a/ff/b/c", + "normalized": "/a/ff/b/c", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/42/a", + "normalized": "/42/a", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/ff", + "normalized": "/ff", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/c/a%20b", + "normalized": "/c/a%20b", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/a/q/..", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "POST", + "PUT", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/7/7/a/x", + "normalized": "/7/7/a/x", + "match": { + "id": "G18.d8", + "params": { + "p0": "7/7/a/x" + } + }, + "resolve": { + "id": "G18.d8", + "params": { + "p0": "7/7/a/x" + }, + "implicitHead": false + }, + "allow": [ + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/", + "normalized": "/", + "match": { + "id": "G18.d4", + "params": {} + }, + "resolve": { + "id": "G18.d4", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/a", + "normalized": "/a", + "match": { + "id": "G18.d2", + "params": { + "p0": "a" + } + }, + "resolve": { + "id": "G18.d2", + "params": { + "p0": "a" + }, + "implicitHead": false + }, + "allow": [ + "HEAD", + "POST", + "PUT", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/x/a", + "normalized": "/x/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "PATCH", + "OPTIONS" + ] + } + ] + }, + { + "id": "G19", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G19.d1", + "method": "PATCH", + "pattern": "/:p0*", + "transport": "buffer" + }, + { + "id": "G19.d2", + "method": "GET", + "pattern": "/x/a", + "transport": "buffer" + }, + { + "id": "G19.d3", + "method": "HEAD", + "pattern": "/:p0(\\d+)", + "transport": "buffer" + }, + { + "id": "G19.d4", + "method": "HEAD", + "pattern": "/a/:p1*", + "transport": "buffer" + }, + { + "id": "G19.d5", + "method": "POST", + "pattern": "/", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/a/c/" + }, + { + "method": "PATCH", + "raw": "/0a/a/0a" + }, + { + "method": "OPTIONS", + "raw": "/a/" + }, + { + "method": "PUT", + "raw": "/b" + }, + { + "method": "GET", + "raw": "/x/a" + }, + { + "method": "PATCH", + "raw": "/ff/" + }, + { + "method": "OPTIONS", + "raw": "/a" + }, + { + "method": "DELETE", + "raw": "/a" + }, + { + "method": "DELETE", + "raw": "/a/%34%32" + }, + { + "method": "GET", + "raw": "/caf%C3%A9" + }, + { + "method": "PATCH", + "raw": "//./caf%C3%A9/7" + }, + { + "method": "OPTIONS", + "raw": "/%34%32" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/a/c/", + "normalized": "/a/c", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/0a/a/0a", + "normalized": "/0a/a/0a", + "match": { + "id": "G19.d1", + "params": { + "p0": "0a/a/0a" + } + }, + "resolve": { + "id": "G19.d1", + "params": { + "p0": "0a/a/0a" + }, + "implicitHead": false + }, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/a/", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/b", + "normalized": "/b", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x/a", + "normalized": "/x/a", + "match": { + "id": "G19.d2", + "params": {} + }, + "resolve": { + "id": "G19.d2", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/ff/", + "normalized": "/ff", + "match": { + "id": "G19.d1", + "params": { + "p0": "ff" + } + }, + "resolve": { + "id": "G19.d1", + "params": { + "p0": "ff" + }, + "implicitHead": false + }, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/a/%34%32", + "normalized": "/a/%34%32", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/caf%C3%A9", + "normalized": "/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "//./caf%C3%A9/7", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "OPTIONS", + "raw": "/%34%32", + "normalized": "/%34%32", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PATCH", + "OPTIONS" + ] + } + ] + }, + { + "id": "G20", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G20.d1", + "method": "OPTIONS", + "pattern": "/x/c/:p2/:p3*", + "transport": "buffer" + }, + { + "id": "G20.d2", + "method": "POST", + "pattern": "/x/:p1*", + "transport": "buffer" + }, + { + "id": "G20.d3", + "method": "PATCH", + "pattern": "/x", + "transport": "buffer" + }, + { + "id": "G20.d4", + "method": "POST", + "pattern": "/:p0/c/:p2(\\d+)", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/c/c/ff" + }, + { + "method": "PATCH", + "raw": "/x/c/caf%C3%A9" + }, + { + "method": "GET", + "raw": "/x" + }, + { + "method": "POST", + "raw": "/x/42/0a/." + }, + { + "method": "POST", + "raw": "/x" + }, + { + "method": "PATCH", + "raw": "/0a/c/" + }, + { + "method": "GET", + "raw": "/x/a/" + }, + { + "method": "GET", + "raw": "/7/" + }, + { + "method": "DELETE", + "raw": "/a%20b/0a/b/c" + }, + { + "method": "PUT", + "raw": "/ff/c/a" + }, + { + "method": "HEAD", + "raw": "/x/c/c/0a/%34%32" + }, + { + "method": "DELETE", + "raw": "/x/c" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/c/c/ff", + "normalized": "/c/c/ff", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/x/c/caf%C3%A9", + "normalized": "/x/c/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "POST", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/x/42/0a/.", + "normalized": "/x/42/0a", + "match": { + "id": "G20.d2", + "params": { + "p1": "42/0a" + } + }, + "resolve": { + "id": "G20.d2", + "params": { + "p1": "42/0a" + }, + "implicitHead": false + }, + "allow": [ + "POST", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/x", + "normalized": "/x", + "match": { + "id": "G20.d2", + "params": { + "p1": "" + } + }, + "resolve": { + "id": "G20.d2", + "params": { + "p1": "" + }, + "implicitHead": false + }, + "allow": [ + "POST", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/0a/c/", + "normalized": "/0a/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/x/a/", + "normalized": "/x/a", + "match": null, + "resolve": null, + "allow": [ + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/7/", + "normalized": "/7", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/a%20b/0a/b/c", + "normalized": "/a%20b/0a/b/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PUT", + "raw": "/ff/c/a", + "normalized": "/ff/c/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/x/c/c/0a/%34%32", + "normalized": "/x/c/c/0a/%34%32", + "match": null, + "resolve": null, + "allow": [ + "POST", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/x/c", + "normalized": "/x/c", + "match": null, + "resolve": null, + "allow": [ + "POST", + "OPTIONS" + ] + } + ] + }, + { + "id": "G21", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G21.d1", + "method": "GET", + "pattern": "/:p0*", + "transport": "buffer" + }, + { + "id": "G21.d2", + "method": "GET", + "pattern": "/a/b", + "transport": "buffer" + }, + { + "id": "G21.d3", + "method": "PATCH", + "pattern": "/b/x/a", + "transport": "buffer" + }, + { + "id": "G21.d4", + "method": "OPTIONS", + "pattern": "/c", + "transport": "buffer" + }, + { + "id": "G21.d5", + "method": "GET", + "pattern": "/:p0([0-9a-f]{2})/:p1([0-9a-f]{2})", + "transport": "sse" + }, + { + "id": "G21.d6", + "method": "DELETE", + "pattern": "/a", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "DELETE", + "raw": "/0a" + }, + { + "method": "OPTIONS", + "raw": "/a/b" + }, + { + "method": "OPTIONS", + "raw": "/0a/a/b" + }, + { + "method": "GET", + "raw": "/b/x/a" + }, + { + "method": "PATCH", + "raw": "/c" + }, + { + "method": "PUT", + "raw": "/." + }, + { + "method": "HEAD", + "raw": "/a/b" + }, + { + "method": "PATCH", + "raw": "/c" + }, + { + "method": "PUT", + "raw": "/./c" + }, + { + "method": "HEAD", + "raw": "/a" + }, + { + "method": "HEAD", + "raw": "/c" + }, + { + "method": "POST", + "raw": "/a/" + } + ], + "outcomes": [ + { + "method": "DELETE", + "raw": "/0a", + "normalized": "/0a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/a/b", + "normalized": "/a/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/0a/a/b", + "normalized": "/0a/a/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/b/x/a", + "normalized": "/b/x/a", + "match": { + "id": "G21.d1", + "params": { + "p0": "b/x/a" + } + }, + "resolve": { + "id": "G21.d1", + "params": { + "p0": "b/x/a" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/.", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/a/b", + "normalized": "/a/b", + "match": null, + "resolve": { + "id": "G21.d2", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/./c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": { + "id": "G21.d1", + "params": { + "p0": "a" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": { + "id": "G21.d1", + "params": { + "p0": "c" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/a/", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "DELETE", + "OPTIONS" + ] + } + ] + }, + { + "id": "G22", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G22.d1", + "method": "GET", + "pattern": "/a/c/x/:p3*", + "transport": "ndjson" + }, + { + "id": "G22.d2", + "method": "OPTIONS", + "pattern": "/x", + "transport": "buffer" + }, + { + "id": "G22.d3", + "method": "DELETE", + "pattern": "/x/a/:p2", + "transport": "buffer" + }, + { + "id": "G22.d4", + "method": "GET", + "pattern": "/:p0/:p1/:p2*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "PATCH", + "raw": "/a%20b/42" + }, + { + "method": "GET", + "raw": "/x/a/b" + }, + { + "method": "GET", + "raw": "/x" + }, + { + "method": "POST", + "raw": "/7/7/0a/b/" + }, + { + "method": "POST", + "raw": "/" + }, + { + "method": "DELETE", + "raw": "/ff/c" + }, + { + "method": "DELETE", + "raw": "/a/q/../c/x" + }, + { + "method": "GET", + "raw": "/x" + }, + { + "method": "PATCH", + "raw": "/42" + }, + { + "method": "GET", + "raw": "/a/c/x/a/7" + }, + { + "method": "OPTIONS", + "raw": "/caf%C3%A9/ff" + }, + { + "method": "GET", + "raw": "/b/%34%32" + } + ], + "outcomes": [ + { + "method": "PATCH", + "raw": "/a%20b/42", + "normalized": "/a%20b/42", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x/a/b", + "normalized": "/x/a/b", + "match": { + "id": "G22.d4", + "params": { + "p0": "x", + "p1": "a", + "p2": "b" + } + }, + "resolve": { + "id": "G22.d4", + "params": { + "p0": "x", + "p1": "a", + "p2": "b" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/7/7/0a/b/", + "normalized": "/7/7/0a/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/ff/c", + "normalized": "/ff/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/a/q/../c/x", + "normalized": "/a/c/x", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/42", + "normalized": "/42", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/a/c/x/a/7", + "normalized": "/a/c/x/a/7", + "match": { + "id": "G22.d1", + "params": { + "p3": "a/7" + } + }, + "resolve": { + "id": "G22.d1", + "params": { + "p3": "a/7" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/caf%C3%A9/ff", + "normalized": "/caf%C3%A9/ff", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/b/%34%32", + "normalized": "/b/%34%32", + "match": { + "id": "G22.d4", + "params": { + "p0": "b", + "p1": "42", + "p2": "" + } + }, + "resolve": { + "id": "G22.d4", + "params": { + "p0": "b", + "p1": "42", + "p2": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "G23", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G23.d1", + "method": "OPTIONS", + "pattern": "/c/:p1/:p2*", + "transport": "buffer" + }, + { + "id": "G23.d2", + "method": "PUT", + "pattern": "/:p0([0-9a-f]{2})/c/:p2*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "PUT", + "raw": "/c/a%20b/caf%C3%A9" + }, + { + "method": "GET", + "raw": "//" + }, + { + "method": "OPTIONS", + "raw": "/42/c/7/c" + }, + { + "method": "GET", + "raw": "/c/ff" + }, + { + "method": "PUT", + "raw": "/c/a/a%20b" + }, + { + "method": "GET", + "raw": "/42/c/7" + }, + { + "method": "HEAD", + "raw": "/0a/c/a/c" + }, + { + "method": "POST", + "raw": "/c/c/b" + }, + { + "method": "GET", + "raw": "/%34%32/" + }, + { + "method": "PUT", + "raw": "/ff" + }, + { + "method": "GET", + "raw": "/c/c/x/a%20b" + }, + { + "method": "GET", + "raw": "/b/c/a%20b/%34%32" + } + ], + "outcomes": [ + { + "method": "PUT", + "raw": "/c/a%20b/caf%C3%A9", + "normalized": "/c/a%20b/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "//", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "OPTIONS", + "raw": "/42/c/7/c", + "normalized": "/42/c/7/c", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/c/ff", + "normalized": "/c/ff", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/c/a/a%20b", + "normalized": "/c/a/a%20b", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/42/c/7", + "normalized": "/42/c/7", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/0a/c/a/c", + "normalized": "/0a/c/a/c", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/c/c/b", + "normalized": "/c/c/b", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/%34%32/", + "normalized": "/%34%32", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PUT", + "raw": "/ff", + "normalized": "/ff", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/c/c/x/a%20b", + "normalized": "/c/c/x/a%20b", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/b/c/a%20b/%34%32", + "normalized": "/b/c/a%20b/%34%32", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "G24", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G24.d1", + "method": "GET", + "pattern": "/c", + "transport": "negotiate" + }, + { + "id": "G24.d2", + "method": "GET", + "pattern": "/x/:p1/:p2", + "transport": "ndjson" + } + ], + "requests": [ + { + "method": "DELETE", + "raw": "/x/b/7" + }, + { + "method": "HEAD", + "raw": "/c" + }, + { + "method": "HEAD", + "raw": "/x/x/a" + }, + { + "method": "PATCH", + "raw": "/c/q/.." + }, + { + "method": "OPTIONS", + "raw": "/x/ff/a%20b" + }, + { + "method": "DELETE", + "raw": "/x/a%20b/%34%32" + }, + { + "method": "HEAD", + "raw": "//ff/7/42/c" + }, + { + "method": "DELETE", + "raw": "/" + }, + { + "method": "PATCH", + "raw": "/x/a%20b/7" + }, + { + "method": "PATCH", + "raw": "/x/x/./0a" + }, + { + "method": "HEAD", + "raw": "/c" + }, + { + "method": "PUT", + "raw": "/c/" + } + ], + "outcomes": [ + { + "method": "DELETE", + "raw": "/x/b/7", + "normalized": "/x/b/7", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/x/x/a", + "normalized": "/x/x/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/c/q/..", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/x/ff/a%20b", + "normalized": "/x/ff/a%20b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/x/a%20b/%34%32", + "normalized": "/x/a%20b/%34%32", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "//ff/7/42/c", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "DELETE", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/x/a%20b/7", + "normalized": "/x/a%20b/7", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/x/x/./0a", + "normalized": "/x/x/0a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/c/", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + } + ] + }, + { + "id": "G25", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G25.d1", + "method": "GET", + "pattern": "/x", + "transport": "buffer" + }, + { + "id": "G25.d2", + "method": "PUT", + "pattern": "/a/:p1([a-c]+)", + "transport": "buffer" + }, + { + "id": "G25.d3", + "method": "POST", + "pattern": "/c/x/a", + "transport": "buffer" + }, + { + "id": "G25.d4", + "method": "GET", + "pattern": "/", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "PATCH", + "raw": "/c/x/a" + }, + { + "method": "PATCH", + "raw": "/7/b" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "GET", + "raw": "/c/x/a" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "PUT", + "raw": "/a" + }, + { + "method": "PATCH", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "POST", + "raw": "/x" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "/x" + }, + { + "method": "PATCH", + "raw": "/a/0a" + } + ], + "outcomes": [ + { + "method": "PATCH", + "raw": "/c/x/a", + "normalized": "/c/x/a", + "match": null, + "resolve": null, + "allow": [ + "POST", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/7/b", + "normalized": "/7/b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": { + "id": "G25.d4", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/c/x/a", + "normalized": "/c/x/a", + "match": null, + "resolve": null, + "allow": [ + "POST", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": { + "id": "G25.d4", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": { + "id": "G25.d4", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": { + "id": "G25.d4", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": { + "id": "G25.d1", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/a/0a", + "normalized": "/a/0a", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "G26", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G26.d1", + "method": "DELETE", + "pattern": "/:p0/:p1([a-c]+)/:p2/:p3*", + "transport": "buffer" + }, + { + "id": "G26.d2", + "method": "GET", + "pattern": "/x/:p1*", + "transport": "sse" + }, + { + "id": "G26.d3", + "method": "GET", + "pattern": "/x", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "HEAD", + "raw": "/b/caf%C3%A9" + }, + { + "method": "PUT", + "raw": "/c/7/a/" + }, + { + "method": "DELETE", + "raw": "/x" + }, + { + "method": "GET", + "raw": "/x" + }, + { + "method": "OPTIONS", + "raw": "/" + }, + { + "method": "GET", + "raw": "/x/ff/./%34%32" + }, + { + "method": "PUT", + "raw": "/0a/caf%C3%A9/x/b/x" + }, + { + "method": "PATCH", + "raw": "/a%20b/a/c/a" + }, + { + "method": "HEAD", + "raw": "/x/%34%32" + }, + { + "method": "OPTIONS", + "raw": "/7/42/x/b/ff" + }, + { + "method": "POST", + "raw": "/x" + }, + { + "method": "PUT", + "raw": "/x/." + } + ], + "outcomes": [ + { + "method": "HEAD", + "raw": "/b/caf%C3%A9", + "normalized": "/b/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PUT", + "raw": "/c/7/a/", + "normalized": "/c/7/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x", + "normalized": "/x", + "match": { + "id": "G26.d3", + "params": {} + }, + "resolve": { + "id": "G26.d3", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/x/ff/./%34%32", + "normalized": "/x/ff/%34%32", + "match": { + "id": "G26.d2", + "params": { + "p1": "ff/42" + } + }, + "resolve": { + "id": "G26.d2", + "params": { + "p1": "ff/42" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/0a/caf%C3%A9/x/b/x", + "normalized": "/0a/caf%C3%A9/x/b/x", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/a%20b/a/c/a", + "normalized": "/a%20b/a/c/a", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/x/%34%32", + "normalized": "/x/%34%32", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/7/42/x/b/ff", + "normalized": "/7/42/x/b/ff", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "POST", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/x/.", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "G27", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G27.d1", + "method": "HEAD", + "pattern": "/a/:p1/:p2([0-9a-f]{2})", + "transport": "buffer" + }, + { + "id": "G27.d2", + "method": "GET", + "pattern": "/b/:p1([a-c]+)/:p2*", + "transport": "sse" + }, + { + "id": "G27.d3", + "method": "DELETE", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G27.d4", + "method": "HEAD", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G27.d5", + "method": "HEAD", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G27.d6", + "method": "DELETE", + "pattern": "/x/:p1*", + "transport": "buffer" + }, + { + "id": "G27.d7", + "method": "PATCH", + "pattern": "/a/c/c", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "PATCH", + "raw": "/x/b/ff" + }, + { + "method": "OPTIONS", + "raw": "/x/b/c" + }, + { + "method": "OPTIONS", + "raw": "/a%20b/42" + }, + { + "method": "POST", + "raw": "/c" + }, + { + "method": "GET", + "raw": "/7/" + }, + { + "method": "GET", + "raw": "/a/42/b" + }, + { + "method": "PATCH", + "raw": "/b/42" + }, + { + "method": "DELETE", + "raw": "/c/a%20b/a%20b/q/../x" + }, + { + "method": "HEAD", + "raw": "/0a/%34%32" + }, + { + "method": "GET", + "raw": "/7/c/42/b" + }, + { + "method": "DELETE", + "raw": "/a/c/c" + }, + { + "method": "POST", + "raw": "/" + } + ], + "outcomes": [ + { + "method": "PATCH", + "raw": "/x/b/ff", + "normalized": "/x/b/ff", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/x/b/c", + "normalized": "/x/b/c", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/a%20b/42", + "normalized": "/a%20b/42", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "POST", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/7/", + "normalized": "/7", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/42/b", + "normalized": "/a/42/b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/b/42", + "normalized": "/b/42", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/c/a%20b/a%20b/q/../x", + "normalized": "/c/a%20b/a%20b/x", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/0a/%34%32", + "normalized": "/0a/%34%32", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/7/c/42/b", + "normalized": "/7/c/42/b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/a/c/c", + "normalized": "/a/c/c", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "G28", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G28.d1", + "method": "DELETE", + "pattern": "/:p0*", + "transport": "buffer" + }, + { + "id": "G28.d2", + "method": "POST", + "pattern": "/x", + "transport": "buffer" + }, + { + "id": "G28.d3", + "method": "GET", + "pattern": "/x/:p1/:p2*", + "transport": "buffer" + }, + { + "id": "G28.d4", + "method": "GET", + "pattern": "/:p0", + "transport": "ndjson" + }, + { + "id": "G28.d5", + "method": "PATCH", + "pattern": "/:p0/:p1([0-9a-f]{2})/:p2", + "transport": "buffer" + }, + { + "id": "G28.d6", + "method": "GET", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G28.d7", + "method": "HEAD", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G28.d8", + "method": "PUT", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G28.d9", + "method": "DELETE", + "pattern": "/a", + "transport": "buffer" + }, + { + "id": "G28.d10", + "method": "PATCH", + "pattern": "/:p0([0-9a-f]{2})/x/:p2/:p3*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "PUT", + "raw": "/0a" + }, + { + "method": "HEAD", + "raw": "/b/a" + }, + { + "method": "PUT", + "raw": "//x" + }, + { + "method": "OPTIONS", + "raw": "/x/caf%C3%A9/%34%32/ff" + }, + { + "method": "PUT", + "raw": "/0a/x" + }, + { + "method": "PATCH", + "raw": "/" + }, + { + "method": "OPTIONS", + "raw": "/a%20b/" + }, + { + "method": "POST", + "raw": "/caf%C3%A9/a%20b/a" + }, + { + "method": "GET", + "raw": "/./x" + }, + { + "method": "GET", + "raw": "/%34%32/caf%C3%A9/./a%20b/ff" + }, + { + "method": "DELETE", + "raw": "/" + }, + { + "method": "GET", + "raw": "/x/0a/x/%34%32" + } + ], + "outcomes": [ + { + "method": "PUT", + "raw": "/0a", + "normalized": "/0a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/b/a", + "normalized": "/b/a", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "//x", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "OPTIONS", + "raw": "/x/caf%C3%A9/%34%32/ff", + "normalized": "/x/caf%C3%A9/%34%32/ff", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/0a/x", + "normalized": "/0a/x", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PUT", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/a%20b/", + "normalized": "/a%20b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/caf%C3%A9/a%20b/a", + "normalized": "/caf%C3%A9/a%20b/a", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/./x", + "normalized": "/x", + "match": { + "id": "G28.d4", + "params": { + "p0": "x" + } + }, + "resolve": { + "id": "G28.d4", + "params": { + "p0": "x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/%34%32/caf%C3%A9/./a%20b/ff", + "normalized": "/%34%32/caf%C3%A9/a%20b/ff", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/", + "normalized": "/", + "match": { + "id": "G28.d1", + "params": { + "p0": "" + } + }, + "resolve": { + "id": "G28.d1", + "params": { + "p0": "" + }, + "implicitHead": false + }, + "allow": [ + "HEAD", + "PUT", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x/0a/x/%34%32", + "normalized": "/x/0a/x/%34%32", + "match": { + "id": "G28.d3", + "params": { + "p1": "0a", + "p2": "x/42" + } + }, + "resolve": { + "id": "G28.d3", + "params": { + "p1": "0a", + "p2": "x/42" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "DELETE", + "OPTIONS" + ] + } + ] + }, + { + "id": "G29", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G29.d1", + "method": "PATCH", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G29.d2", + "method": "POST", + "pattern": "/a/:p1([0-9a-f]{2})/:p2(\\d+)", + "transport": "buffer" + }, + { + "id": "G29.d3", + "method": "HEAD", + "pattern": "/:p0(\\d+)", + "transport": "buffer" + }, + { + "id": "G29.d4", + "method": "GET", + "pattern": "/:p0([0-9a-f]{2})/b", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "HEAD", + "raw": "/a" + }, + { + "method": "OPTIONS", + "raw": "/x/c/" + }, + { + "method": "PUT", + "raw": "/%34%32/c" + }, + { + "method": "DELETE", + "raw": "/caf%C3%A9/a" + }, + { + "method": "OPTIONS", + "raw": "/ff/b" + }, + { + "method": "POST", + "raw": "/7/b" + }, + { + "method": "GET", + "raw": "/42" + }, + { + "method": "GET", + "raw": "/a" + }, + { + "method": "POST", + "raw": "/%34%32" + }, + { + "method": "GET", + "raw": "/7" + }, + { + "method": "PUT", + "raw": "/x/b" + }, + { + "method": "PATCH", + "raw": "/%34%32" + } + ], + "outcomes": [ + { + "method": "HEAD", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/x/c/", + "normalized": "/x/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PUT", + "raw": "/%34%32/c", + "normalized": "/%34%32/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/caf%C3%A9/a", + "normalized": "/caf%C3%A9/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "OPTIONS", + "raw": "/ff/b", + "normalized": "/ff/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/7/b", + "normalized": "/7/b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/42", + "normalized": "/42", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/%34%32", + "normalized": "/%34%32", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/7", + "normalized": "/7", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/x/b", + "normalized": "/x/b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/%34%32", + "normalized": "/%34%32", + "match": { + "id": "G29.d1", + "params": { + "p0": "42" + } + }, + "resolve": { + "id": "G29.d1", + "params": { + "p0": "42" + }, + "implicitHead": false + }, + "allow": [ + "HEAD", + "PATCH", + "OPTIONS" + ] + } + ] + }, + { + "id": "G30", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G30.d1", + "method": "GET", + "pattern": "/a", + "transport": "ndjson" + }, + { + "id": "G30.d2", + "method": "OPTIONS", + "pattern": "/c/:p1/b/:p3*", + "transport": "buffer" + }, + { + "id": "G30.d3", + "method": "GET", + "pattern": "/:p0(\\d+)/:p1", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "OPTIONS", + "raw": "/a" + }, + { + "method": "GET", + "raw": "/c/caf%C3%A9" + }, + { + "method": "HEAD", + "raw": "/c/b/b/%34%32/" + }, + { + "method": "POST", + "raw": "/c/q/.." + }, + { + "method": "GET", + "raw": "/a/x" + }, + { + "method": "OPTIONS", + "raw": "/7" + }, + { + "method": "POST", + "raw": "/0a/caf%C3%A9" + }, + { + "method": "GET", + "raw": "/a%20b/42/b/a" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "GET", + "raw": "/caf%C3%A9/a" + }, + { + "method": "GET", + "raw": "/ff/0a/7/c/" + }, + { + "method": "OPTIONS", + "raw": "/a" + } + ], + "outcomes": [ + { + "method": "OPTIONS", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/c/caf%C3%A9", + "normalized": "/c/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/c/b/b/%34%32/", + "normalized": "/c/b/b/%34%32", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/c/q/..", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/a/x", + "normalized": "/a/x", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "OPTIONS", + "raw": "/7", + "normalized": "/7", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "POST", + "raw": "/0a/caf%C3%A9", + "normalized": "/0a/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/a%20b/42/b/a", + "normalized": "/a%20b/42/b/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/caf%C3%A9/a", + "normalized": "/caf%C3%A9/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/ff/0a/7/c/", + "normalized": "/ff/0a/7/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "OPTIONS", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + } + ] + }, + { + "id": "G31", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G31.d1", + "method": "GET", + "pattern": "/:p0(\\d+)", + "transport": "buffer" + }, + { + "id": "G31.d2", + "method": "PATCH", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G31.d3", + "method": "GET", + "pattern": "/:p0*", + "transport": "buffer" + }, + { + "id": "G31.d4", + "method": "GET", + "pattern": "/:p0/x", + "transport": "buffer" + }, + { + "id": "G31.d5", + "method": "DELETE", + "pattern": "/:p0([a-c]+)", + "transport": "buffer" + }, + { + "id": "G31.d6", + "method": "PUT", + "pattern": "/x/:p1(\\d+)", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "HEAD", + "raw": "/7/0a" + }, + { + "method": "GET", + "raw": "//x/7" + }, + { + "method": "POST", + "raw": "/%34%32/" + }, + { + "method": "POST", + "raw": "/42/%34%32" + }, + { + "method": "POST", + "raw": "/7/ff" + }, + { + "method": "PATCH", + "raw": "/b" + }, + { + "method": "GET", + "raw": "/a" + }, + { + "method": "OPTIONS", + "raw": "/x/x" + }, + { + "method": "OPTIONS", + "raw": "/0a/b" + }, + { + "method": "DELETE", + "raw": "/q/../x/b" + }, + { + "method": "HEAD", + "raw": "/caf%C3%A9/x/." + }, + { + "method": "DELETE", + "raw": "/" + } + ], + "outcomes": [ + { + "method": "HEAD", + "raw": "/7/0a", + "normalized": "/7/0a", + "match": null, + "resolve": { + "id": "G31.d3", + "params": { + "p0": "7/0a" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "//x/7", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "POST", + "raw": "/%34%32/", + "normalized": "/%34%32", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/42/%34%32", + "normalized": "/42/%34%32", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/7/ff", + "normalized": "/7/ff", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/b", + "normalized": "/b", + "match": { + "id": "G31.d2", + "params": { + "p0": "b" + } + }, + "resolve": { + "id": "G31.d2", + "params": { + "p0": "b" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a", + "normalized": "/a", + "match": { + "id": "G31.d3", + "params": { + "p0": "a" + } + }, + "resolve": { + "id": "G31.d3", + "params": { + "p0": "a" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/x/x", + "normalized": "/x/x", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/0a/b", + "normalized": "/0a/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/q/../x/b", + "normalized": "/x/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/caf%C3%A9/x/.", + "normalized": "/caf%C3%A9/x", + "match": null, + "resolve": { + "id": "G31.d4", + "params": { + "p0": "café" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "G32", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G32.d1", + "method": "POST", + "pattern": "/:p0/:p1/x", + "transport": "buffer" + }, + { + "id": "G32.d2", + "method": "PATCH", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G32.d3", + "method": "GET", + "pattern": "/:p0*", + "transport": "sse" + }, + { + "id": "G32.d4", + "method": "POST", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G32.d5", + "method": "HEAD", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G32.d6", + "method": "PATCH", + "pattern": "/:p0/:p1([a-c]+)/:p2/:p3*", + "transport": "buffer" + }, + { + "id": "G32.d7", + "method": "DELETE", + "pattern": "/:p0/b/:p2([0-9a-f]{2})", + "transport": "buffer" + }, + { + "id": "G32.d8", + "method": "GET", + "pattern": "/", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/" + }, + { + "method": "PATCH", + "raw": "/42/b/ff/" + }, + { + "method": "OPTIONS", + "raw": "/." + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "POST", + "raw": "/b/b/a/42" + }, + { + "method": "PATCH", + "raw": "/./b" + }, + { + "method": "DELETE", + "raw": "/a" + }, + { + "method": "DELETE", + "raw": "/caf%C3%A9/c/x" + }, + { + "method": "GET", + "raw": "/caf%C3%A9" + }, + { + "method": "OPTIONS", + "raw": "/q/.." + }, + { + "method": "POST", + "raw": "/a/0a/a%20b" + }, + { + "method": "DELETE", + "raw": "//" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G32.d8", + "params": {} + }, + "resolve": { + "id": "G32.d8", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/42/b/ff/", + "normalized": "/42/b/ff", + "match": { + "id": "G32.d6", + "params": { + "p0": "42", + "p1": "b", + "p2": "ff", + "p3": "" + } + }, + "resolve": { + "id": "G32.d6", + "params": { + "p0": "42", + "p1": "b", + "p2": "ff", + "p3": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/.", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G32.d8", + "params": {} + }, + "resolve": { + "id": "G32.d8", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/b/b/a/42", + "normalized": "/b/b/a/42", + "match": null, + "resolve": null, + "allow": [ + "GET", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/./b", + "normalized": "/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/caf%C3%A9/c/x", + "normalized": "/caf%C3%A9/c/x", + "match": null, + "resolve": null, + "allow": [ + "GET", + "POST", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/caf%C3%A9", + "normalized": "/caf%C3%A9", + "match": { + "id": "G32.d3", + "params": { + "p0": "café" + } + }, + "resolve": { + "id": "G32.d3", + "params": { + "p0": "café" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/q/..", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/a/0a/a%20b", + "normalized": "/a/0a/a%20b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "//", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + } + ] + }, + { + "id": "G33", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G33.d1", + "method": "GET", + "pattern": "/c/:p1", + "transport": "buffer" + }, + { + "id": "G33.d2", + "method": "GET", + "pattern": "/", + "transport": "sse" + }, + { + "id": "G33.d3", + "method": "GET", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G33.d4", + "method": "PATCH", + "pattern": "/", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/" + }, + { + "method": "POST", + "raw": "/c/a/." + }, + { + "method": "DELETE", + "raw": "/c/a%20b/" + }, + { + "method": "PUT", + "raw": "/." + }, + { + "method": "PATCH", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "/c/" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "DELETE", + "raw": "/b/%34%32/0a/7" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "/c/a" + }, + { + "method": "GET", + "raw": "/%34%32" + }, + { + "method": "GET", + "raw": "/" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G33.d2", + "params": {} + }, + "resolve": { + "id": "G33.d2", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/c/a/.", + "normalized": "/c/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/c/a%20b/", + "normalized": "/c/a%20b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/.", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/", + "normalized": "/", + "match": { + "id": "G33.d4", + "params": {} + }, + "resolve": { + "id": "G33.d4", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/c/", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G33.d2", + "params": {} + }, + "resolve": { + "id": "G33.d2", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/b/%34%32/0a/7", + "normalized": "/b/%34%32/0a/7", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": { + "id": "G33.d3", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/c/a", + "normalized": "/c/a", + "match": null, + "resolve": { + "id": "G33.d1", + "params": { + "p1": "a" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/%34%32", + "normalized": "/%34%32", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G33.d2", + "params": {} + }, + "resolve": { + "id": "G33.d2", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + } + ] + }, + { + "id": "G34", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G34.d1", + "method": "PATCH", + "pattern": "/:p0([0-9a-f]{2})/c/:p2*", + "transport": "buffer" + }, + { + "id": "G34.d2", + "method": "DELETE", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G34.d3", + "method": "HEAD", + "pattern": "/b", + "transport": "buffer" + }, + { + "id": "G34.d4", + "method": "GET", + "pattern": "/a", + "transport": "buffer" + }, + { + "id": "G34.d5", + "method": "HEAD", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G34.d6", + "method": "GET", + "pattern": "/c/c", + "transport": "ndjson" + }, + { + "id": "G34.d7", + "method": "DELETE", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G34.d8", + "method": "PUT", + "pattern": "/b", + "transport": "buffer" + }, + { + "id": "G34.d9", + "method": "GET", + "pattern": "/", + "transport": "negotiate" + }, + { + "id": "G34.d10", + "method": "OPTIONS", + "pattern": "/c/a/b", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "PUT", + "raw": "/ff" + }, + { + "method": "GET", + "raw": "/0a/caf%C3%A9/a%20b/ff" + }, + { + "method": "POST", + "raw": "/" + }, + { + "method": "DELETE", + "raw": "/." + }, + { + "method": "GET", + "raw": "/c" + }, + { + "method": "PATCH", + "raw": "/b/c" + }, + { + "method": "GET", + "raw": "/c/a" + }, + { + "method": "POST", + "raw": "/a/caf%C3%A9" + }, + { + "method": "OPTIONS", + "raw": "/caf%C3%A9/7/x" + }, + { + "method": "OPTIONS", + "raw": "/b" + }, + { + "method": "GET", + "raw": "/b/x/0a/x" + }, + { + "method": "DELETE", + "raw": "/x/7/b/ff" + } + ], + "outcomes": [ + { + "method": "PUT", + "raw": "/ff", + "normalized": "/ff", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/0a/caf%C3%A9/a%20b/ff", + "normalized": "/0a/caf%C3%A9/a%20b/ff", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "POST", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/.", + "normalized": "/", + "match": { + "id": "G34.d2", + "params": {} + }, + "resolve": { + "id": "G34.d2", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/b/c", + "normalized": "/b/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/c/a", + "normalized": "/c/a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "POST", + "raw": "/a/caf%C3%A9", + "normalized": "/a/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "OPTIONS", + "raw": "/caf%C3%A9/7/x", + "normalized": "/caf%C3%A9/7/x", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "OPTIONS", + "raw": "/b", + "normalized": "/b", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PUT", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/b/x/0a/x", + "normalized": "/b/x/0a/x", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/x/7/b/ff", + "normalized": "/x/7/b/ff", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "G35", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G35.d1", + "method": "GET", + "pattern": "/:p0(\\d+)", + "transport": "ndjson" + }, + { + "id": "G35.d2", + "method": "OPTIONS", + "pattern": "/:p0/c/:p2", + "transport": "buffer" + }, + { + "id": "G35.d3", + "method": "OPTIONS", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G35.d4", + "method": "OPTIONS", + "pattern": "/a/:p1([a-c]+)/c", + "transport": "buffer" + }, + { + "id": "G35.d5", + "method": "HEAD", + "pattern": "/:p0([a-c]+)", + "transport": "buffer" + }, + { + "id": "G35.d6", + "method": "OPTIONS", + "pattern": "/:p0", + "transport": "buffer" + }, + { + "id": "G35.d7", + "method": "GET", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G35.d8", + "method": "POST", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G35.d9", + "method": "PATCH", + "pattern": "/c", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "HEAD", + "raw": "/%34%32/0a/a%20b" + }, + { + "method": "DELETE", + "raw": "/c/q/.." + }, + { + "method": "GET", + "raw": "/a%20b/c/%34%32" + }, + { + "method": "GET", + "raw": "//a" + }, + { + "method": "OPTIONS", + "raw": "//" + }, + { + "method": "PUT", + "raw": "//a/0a/c" + }, + { + "method": "DELETE", + "raw": "/" + }, + { + "method": "POST", + "raw": "/b/42/42/42" + }, + { + "method": "POST", + "raw": "/" + }, + { + "method": "PUT", + "raw": "/x" + }, + { + "method": "DELETE", + "raw": "/ff/c/42" + }, + { + "method": "HEAD", + "raw": "/ff/a/x" + } + ], + "outcomes": [ + { + "method": "HEAD", + "raw": "/%34%32/0a/a%20b", + "normalized": "/%34%32/0a/a%20b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/c/q/..", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a%20b/c/%34%32", + "normalized": "/a%20b/c/%34%32", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "//a", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "OPTIONS", + "raw": "//", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "PUT", + "raw": "//a/0a/c", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "DELETE", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/b/42/42/42", + "normalized": "/b/42/42/42", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "POST", + "raw": "/", + "normalized": "/", + "match": { + "id": "G35.d8", + "params": {} + }, + "resolve": { + "id": "G35.d8", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/ff/c/42", + "normalized": "/ff/c/42", + "match": null, + "resolve": null, + "allow": [ + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/ff/a/x", + "normalized": "/ff/a/x", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "G36", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G36.d1", + "method": "GET", + "pattern": "/:p0([0-9a-f]{2})/:p1*", + "transport": "buffer" + }, + { + "id": "G36.d2", + "method": "GET", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G36.d3", + "method": "PATCH", + "pattern": "/:p0*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "DELETE", + "raw": "/%34%32" + }, + { + "method": "POST", + "raw": "/42/ff/%34%32" + }, + { + "method": "PATCH", + "raw": "/42/a%20b/c/a%20b" + }, + { + "method": "PUT", + "raw": "/42/" + }, + { + "method": "DELETE", + "raw": "/ff/caf%C3%A9/%34%32/42" + }, + { + "method": "PATCH", + "raw": "/7/a%20b/x" + }, + { + "method": "PATCH", + "raw": "/" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "PUT", + "raw": "/" + }, + { + "method": "GET", + "raw": "/%34%32/0a" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "GET", + "raw": "/a" + } + ], + "outcomes": [ + { + "method": "DELETE", + "raw": "/%34%32", + "normalized": "/%34%32", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/42/ff/%34%32", + "normalized": "/42/ff/%34%32", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/42/a%20b/c/a%20b", + "normalized": "/42/a%20b/c/a%20b", + "match": { + "id": "G36.d3", + "params": { + "p0": "42/a b/c/a b" + } + }, + "resolve": { + "id": "G36.d3", + "params": { + "p0": "42/a b/c/a b" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/42/", + "normalized": "/42", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/ff/caf%C3%A9/%34%32/42", + "normalized": "/ff/caf%C3%A9/%34%32/42", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/7/a%20b/x", + "normalized": "/7/a%20b/x", + "match": { + "id": "G36.d3", + "params": { + "p0": "7/a b/x" + } + }, + "resolve": { + "id": "G36.d3", + "params": { + "p0": "7/a b/x" + }, + "implicitHead": false + }, + "allow": [ + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/", + "normalized": "/", + "match": { + "id": "G36.d3", + "params": { + "p0": "" + } + }, + "resolve": { + "id": "G36.d3", + "params": { + "p0": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G36.d2", + "params": {} + }, + "resolve": { + "id": "G36.d2", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/%34%32/0a", + "normalized": "/%34%32/0a", + "match": { + "id": "G36.d1", + "params": { + "p0": "42", + "p1": "0a" + } + }, + "resolve": { + "id": "G36.d1", + "params": { + "p0": "42", + "p1": "0a" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G36.d2", + "params": {} + }, + "resolve": { + "id": "G36.d2", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "PATCH", + "OPTIONS" + ] + } + ] + }, + { + "id": "G37", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G37.d1", + "method": "PATCH", + "pattern": "/:p0*", + "transport": "buffer" + }, + { + "id": "G37.d2", + "method": "GET", + "pattern": "/b/c/:p2", + "transport": "buffer" + }, + { + "id": "G37.d3", + "method": "PUT", + "pattern": "/:p0*", + "transport": "buffer" + }, + { + "id": "G37.d4", + "method": "PATCH", + "pattern": "/:p0*", + "transport": "buffer" + }, + { + "id": "G37.d5", + "method": "DELETE", + "pattern": "/", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "POST", + "raw": "//./caf%C3%A9" + }, + { + "method": "DELETE", + "raw": "/b/a/%34%32/a%20b" + }, + { + "method": "POST", + "raw": "/" + }, + { + "method": "OPTIONS", + "raw": "/b/c/a/" + }, + { + "method": "PUT", + "raw": "/ff/c/42" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "PUT", + "raw": "/7/7/x/c/" + }, + { + "method": "HEAD", + "raw": "/x" + }, + { + "method": "POST", + "raw": "/b/c/caf%C3%A9/." + }, + { + "method": "GET", + "raw": "//" + }, + { + "method": "HEAD", + "raw": "/b/c/x" + }, + { + "method": "HEAD", + "raw": "/42" + } + ], + "outcomes": [ + { + "method": "POST", + "raw": "//./caf%C3%A9", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "DELETE", + "raw": "/b/a/%34%32/a%20b", + "normalized": "/b/a/%34%32/a%20b", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/b/c/a/", + "normalized": "/b/c/a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PUT", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/ff/c/42", + "normalized": "/ff/c/42", + "match": { + "id": "G37.d3", + "params": { + "p0": "ff/c/42" + } + }, + "resolve": { + "id": "G37.d3", + "params": { + "p0": "ff/c/42" + }, + "implicitHead": false + }, + "allow": [ + "PUT", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/7/7/x/c/", + "normalized": "/7/7/x/c", + "match": { + "id": "G37.d3", + "params": { + "p0": "7/7/x/c" + } + }, + "resolve": { + "id": "G37.d3", + "params": { + "p0": "7/7/x/c" + }, + "implicitHead": false + }, + "allow": [ + "PUT", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/x", + "normalized": "/x", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/b/c/caf%C3%A9/.", + "normalized": "/b/c/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PUT", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "//", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "HEAD", + "raw": "/b/c/x", + "normalized": "/b/c/x", + "match": null, + "resolve": { + "id": "G37.d2", + "params": { + "p2": "x" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "PUT", + "PATCH", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/42", + "normalized": "/42", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "PATCH", + "OPTIONS" + ] + } + ] + }, + { + "id": "G38", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G38.d1", + "method": "HEAD", + "pattern": "/x/:p1(\\d+)/:p2", + "transport": "buffer" + }, + { + "id": "G38.d2", + "method": "POST", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G38.d3", + "method": "GET", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G38.d4", + "method": "POST", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G38.d5", + "method": "GET", + "pattern": "/:p0([a-c]+)/a", + "transport": "ndjson" + }, + { + "id": "G38.d6", + "method": "OPTIONS", + "pattern": "/x/a", + "transport": "buffer" + }, + { + "id": "G38.d7", + "method": "GET", + "pattern": "/a", + "transport": "negotiate" + }, + { + "id": "G38.d8", + "method": "GET", + "pattern": "/:p0([0-9a-f]{2})", + "transport": "negotiate" + }, + { + "id": "G38.d9", + "method": "GET", + "pattern": "/b", + "transport": "buffer" + }, + { + "id": "G38.d10", + "method": "POST", + "pattern": "/", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/a%20b" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "GET", + "raw": "/x/ff/c" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "HEAD", + "raw": "/c/42/0a/7" + }, + { + "method": "GET", + "raw": "/." + }, + { + "method": "PUT", + "raw": "/b/7/b/0a" + }, + { + "method": "PATCH", + "raw": "/c" + }, + { + "method": "DELETE", + "raw": "/0a" + }, + { + "method": "PUT", + "raw": "/caf%C3%A9/42" + }, + { + "method": "POST", + "raw": "/ff" + }, + { + "method": "PUT", + "raw": "/q/.." + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/a%20b", + "normalized": "/a%20b", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": { + "id": "G38.d3", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x/ff/c", + "normalized": "/x/ff/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G38.d3", + "params": {} + }, + "resolve": { + "id": "G38.d3", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/c/42/0a/7", + "normalized": "/c/42/0a/7", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/.", + "normalized": "/", + "match": { + "id": "G38.d3", + "params": {} + }, + "resolve": { + "id": "G38.d3", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/b/7/b/0a", + "normalized": "/b/7/b/0a", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "PATCH", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "DELETE", + "raw": "/0a", + "normalized": "/0a", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/caf%C3%A9/42", + "normalized": "/caf%C3%A9/42", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "POST", + "raw": "/ff", + "normalized": "/ff", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/q/..", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + } + ] + }, + { + "id": "G39", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G39.d1", + "method": "PUT", + "pattern": "/b/:p1/:p2*", + "transport": "buffer" + }, + { + "id": "G39.d2", + "method": "DELETE", + "pattern": "/:p0*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "PATCH", + "raw": "/b/42" + }, + { + "method": "DELETE", + "raw": "/" + }, + { + "method": "PUT", + "raw": "/%34%32" + }, + { + "method": "GET", + "raw": "/b/a/0a/a" + }, + { + "method": "OPTIONS", + "raw": "/7/%34%32/caf%C3%A9" + }, + { + "method": "DELETE", + "raw": "/q/../b/b/x" + }, + { + "method": "HEAD", + "raw": "/c" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "PATCH", + "raw": "/a/" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "GET", + "raw": "/b/ff/%34%32/q/.." + }, + { + "method": "PUT", + "raw": "/caf%C3%A9/caf%C3%A9/" + } + ], + "outcomes": [ + { + "method": "PATCH", + "raw": "/b/42", + "normalized": "/b/42", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/", + "normalized": "/", + "match": { + "id": "G39.d2", + "params": { + "p0": "" + } + }, + "resolve": { + "id": "G39.d2", + "params": { + "p0": "" + }, + "implicitHead": false + }, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/%34%32", + "normalized": "/%34%32", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/b/a/0a/a", + "normalized": "/b/a/0a/a", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/7/%34%32/caf%C3%A9", + "normalized": "/7/%34%32/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/q/../b/b/x", + "normalized": "/b/b/x", + "match": { + "id": "G39.d2", + "params": { + "p0": "b/b/x" + } + }, + "resolve": { + "id": "G39.d2", + "params": { + "p0": "b/b/x" + }, + "implicitHead": false + }, + "allow": [ + "PUT", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/c", + "normalized": "/c", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/a/", + "normalized": "/a", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/b/ff/%34%32/q/..", + "normalized": "/b/ff/%34%32", + "match": null, + "resolve": null, + "allow": [ + "PUT", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/caf%C3%A9/caf%C3%A9/", + "normalized": "/caf%C3%A9/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + } + ] + }, + { + "id": "G40", + "note": "generated by router-parity-gen-v1, seed 10908", + "declarations": [ + { + "id": "G40.d1", + "method": "PATCH", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G40.d2", + "method": "PATCH", + "pattern": "/c", + "transport": "buffer" + }, + { + "id": "G40.d3", + "method": "PATCH", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G40.d4", + "method": "DELETE", + "pattern": "/:p0*", + "transport": "buffer" + }, + { + "id": "G40.d5", + "method": "PATCH", + "pattern": "/:p0([a-c]+)/:p1(\\d+)/a", + "transport": "buffer" + }, + { + "id": "G40.d6", + "method": "GET", + "pattern": "/", + "transport": "buffer" + }, + { + "id": "G40.d7", + "method": "DELETE", + "pattern": "/b/:p1*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "HEAD", + "raw": "//" + }, + { + "method": "POST", + "raw": "/7" + }, + { + "method": "GET", + "raw": "/ff/c/ff" + }, + { + "method": "HEAD", + "raw": "/" + }, + { + "method": "DELETE", + "raw": "/" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "PUT", + "raw": "/b/0a/a" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "PATCH", + "raw": "/c/a/a/c" + }, + { + "method": "OPTIONS", + "raw": "/42/b/x" + }, + { + "method": "PUT", + "raw": "/a/0a/." + }, + { + "method": "OPTIONS", + "raw": "/" + } + ], + "outcomes": [ + { + "method": "HEAD", + "raw": "//", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "POST", + "raw": "/7", + "normalized": "/7", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/ff/c/ff", + "normalized": "/ff/c/ff", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": { + "id": "G40.d6", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/", + "normalized": "/", + "match": { + "id": "G40.d4", + "params": { + "p0": "" + } + }, + "resolve": { + "id": "G40.d4", + "params": { + "p0": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G40.d6", + "params": {} + }, + "resolve": { + "id": "G40.d6", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/b/0a/a", + "normalized": "/b/0a/a", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "G40.d6", + "params": {} + }, + "resolve": { + "id": "G40.d6", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/c/a/a/c", + "normalized": "/c/a/a/c", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/42/b/x", + "normalized": "/42/b/x", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/a/0a/.", + "normalized": "/a/0a", + "match": null, + "resolve": null, + "allow": [ + "DELETE", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "PATCH", + "DELETE", + "OPTIONS" + ] + } + ] + } + ] + } +} diff --git a/test/router-parity/frozen/matcher-hand.json b/test/router-parity/frozen/matcher-hand.json new file mode 100644 index 0000000..6c031eb --- /dev/null +++ b/test/router-parity/frozen/matcher-hand.json @@ -0,0 +1,3324 @@ +{ + "revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a", + "data": [ + { + "id": "H01-rank", + "note": "static beats plain param beats catch-all", + "declarations": [ + { + "id": "catchAll", + "method": "GET", + "pattern": "/a/:rest*", + "transport": "buffer" + }, + { + "id": "param", + "method": "GET", + "pattern": "/a/:id", + "transport": "buffer" + }, + { + "id": "static", + "method": "GET", + "pattern": "/a/b", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/a/b" + }, + { + "method": "GET", + "raw": "/a/x" + }, + { + "method": "GET", + "raw": "/a/x/y" + }, + { + "method": "GET", + "raw": "/a" + }, + { + "method": "GET", + "raw": "/a/" + }, + { + "method": "HEAD", + "raw": "/a/x" + }, + { + "method": "OPTIONS", + "raw": "/a/b" + }, + { + "method": "POST", + "raw": "/a/b" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/a/b", + "normalized": "/a/b", + "match": { + "id": "static", + "params": {} + }, + "resolve": { + "id": "static", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/x", + "normalized": "/a/x", + "match": { + "id": "param", + "params": { + "id": "x" + } + }, + "resolve": { + "id": "param", + "params": { + "id": "x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/x/y", + "normalized": "/a/x/y", + "match": { + "id": "catchAll", + "params": { + "rest": "x/y" + } + }, + "resolve": { + "id": "catchAll", + "params": { + "rest": "x/y" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a", + "normalized": "/a", + "match": { + "id": "catchAll", + "params": { + "rest": "" + } + }, + "resolve": { + "id": "catchAll", + "params": { + "rest": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/", + "normalized": "/a", + "match": { + "id": "catchAll", + "params": { + "rest": "" + } + }, + "resolve": { + "id": "catchAll", + "params": { + "rest": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/a/x", + "normalized": "/a/x", + "match": null, + "resolve": { + "id": "param", + "params": { + "id": "x" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/a/b", + "normalized": "/a/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/a/b", + "normalized": "/a/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "H02-rank-reversed", + "note": "static beats plain param beats catch-all (declarations reversed)", + "declarations": [ + { + "id": "static", + "method": "GET", + "pattern": "/a/b", + "transport": "buffer" + }, + { + "id": "param", + "method": "GET", + "pattern": "/a/:id", + "transport": "buffer" + }, + { + "id": "catchAll", + "method": "GET", + "pattern": "/a/:rest*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/a/b" + }, + { + "method": "GET", + "raw": "/a/x" + }, + { + "method": "GET", + "raw": "/a/x/y" + }, + { + "method": "GET", + "raw": "/a" + }, + { + "method": "GET", + "raw": "/a/" + }, + { + "method": "HEAD", + "raw": "/a/x" + }, + { + "method": "OPTIONS", + "raw": "/a/b" + }, + { + "method": "POST", + "raw": "/a/b" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/a/b", + "normalized": "/a/b", + "match": { + "id": "static", + "params": {} + }, + "resolve": { + "id": "static", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/x", + "normalized": "/a/x", + "match": { + "id": "param", + "params": { + "id": "x" + } + }, + "resolve": { + "id": "param", + "params": { + "id": "x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/x/y", + "normalized": "/a/x/y", + "match": { + "id": "catchAll", + "params": { + "rest": "x/y" + } + }, + "resolve": { + "id": "catchAll", + "params": { + "rest": "x/y" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a", + "normalized": "/a", + "match": { + "id": "catchAll", + "params": { + "rest": "" + } + }, + "resolve": { + "id": "catchAll", + "params": { + "rest": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/", + "normalized": "/a", + "match": { + "id": "catchAll", + "params": { + "rest": "" + } + }, + "resolve": { + "id": "catchAll", + "params": { + "rest": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/a/x", + "normalized": "/a/x", + "match": null, + "resolve": { + "id": "param", + "params": { + "id": "x" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/a/b", + "normalized": "/a/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/a/b", + "normalized": "/a/b", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "H03-constraint", + "note": "constrained param beats plain param; constraint tested against the decoded segment", + "declarations": [ + { + "id": "plain", + "method": "GET", + "pattern": "/users/:value", + "transport": "buffer" + }, + { + "id": "digits", + "method": "GET", + "pattern": "/users/:id(\\d+)", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/users/42" + }, + { + "method": "GET", + "raw": "/users/alice" + }, + { + "method": "GET", + "raw": "/users/42x" + }, + { + "method": "GET", + "raw": "/users/%34%32" + }, + { + "method": "GET", + "raw": "/users/" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/users/42", + "normalized": "/users/42", + "match": { + "id": "digits", + "params": { + "id": "42" + } + }, + "resolve": { + "id": "digits", + "params": { + "id": "42" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/users/alice", + "normalized": "/users/alice", + "match": { + "id": "plain", + "params": { + "value": "alice" + } + }, + "resolve": { + "id": "plain", + "params": { + "value": "alice" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/users/42x", + "normalized": "/users/42x", + "match": { + "id": "plain", + "params": { + "value": "42x" + } + }, + "resolve": { + "id": "plain", + "params": { + "value": "42x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/users/%34%32", + "normalized": "/users/%34%32", + "match": { + "id": "digits", + "params": { + "id": "42" + } + }, + "resolve": { + "id": "digits", + "params": { + "id": "42" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/users/", + "normalized": "/users", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "H04-constraint-reversed", + "note": "constrained param beats plain param; constraint tested against the decoded segment (declarations reversed)", + "declarations": [ + { + "id": "digits", + "method": "GET", + "pattern": "/users/:id(\\d+)", + "transport": "buffer" + }, + { + "id": "plain", + "method": "GET", + "pattern": "/users/:value", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/users/42" + }, + { + "method": "GET", + "raw": "/users/alice" + }, + { + "method": "GET", + "raw": "/users/42x" + }, + { + "method": "GET", + "raw": "/users/%34%32" + }, + { + "method": "GET", + "raw": "/users/" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/users/42", + "normalized": "/users/42", + "match": { + "id": "digits", + "params": { + "id": "42" + } + }, + "resolve": { + "id": "digits", + "params": { + "id": "42" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/users/alice", + "normalized": "/users/alice", + "match": { + "id": "plain", + "params": { + "value": "alice" + } + }, + "resolve": { + "id": "plain", + "params": { + "value": "alice" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/users/42x", + "normalized": "/users/42x", + "match": { + "id": "plain", + "params": { + "value": "42x" + } + }, + "resolve": { + "id": "plain", + "params": { + "value": "42x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/users/%34%32", + "normalized": "/users/%34%32", + "match": { + "id": "digits", + "params": { + "id": "42" + } + }, + "resolve": { + "id": "digits", + "params": { + "id": "42" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/users/", + "normalized": "/users", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "H05-constraint-tie", + "note": "two overlapping constraints of equal rank: registration order decides", + "declarations": [ + { + "id": "digits", + "method": "GET", + "pattern": "/n/:num(\\d+)", + "transport": "buffer" + }, + { + "id": "hex", + "method": "GET", + "pattern": "/n/:code([0-9a-f]+)", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/n/42" + }, + { + "method": "GET", + "raw": "/n/ff" + }, + { + "method": "GET", + "raw": "/n/4f" + }, + { + "method": "GET", + "raw": "/n/zz" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/n/42", + "normalized": "/n/42", + "match": { + "id": "digits", + "params": { + "num": "42" + } + }, + "resolve": { + "id": "digits", + "params": { + "num": "42" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/n/ff", + "normalized": "/n/ff", + "match": { + "id": "hex", + "params": { + "code": "ff" + } + }, + "resolve": { + "id": "hex", + "params": { + "code": "ff" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/n/4f", + "normalized": "/n/4f", + "match": { + "id": "hex", + "params": { + "code": "4f" + } + }, + "resolve": { + "id": "hex", + "params": { + "code": "4f" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/n/zz", + "normalized": "/n/zz", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "H06-constraint-tie-reversed", + "note": "two overlapping constraints of equal rank: registration order decides (declarations reversed)", + "declarations": [ + { + "id": "hex", + "method": "GET", + "pattern": "/n/:code([0-9a-f]+)", + "transport": "buffer" + }, + { + "id": "digits", + "method": "GET", + "pattern": "/n/:num(\\d+)", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/n/42" + }, + { + "method": "GET", + "raw": "/n/ff" + }, + { + "method": "GET", + "raw": "/n/4f" + }, + { + "method": "GET", + "raw": "/n/zz" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/n/42", + "normalized": "/n/42", + "match": { + "id": "hex", + "params": { + "code": "42" + } + }, + "resolve": { + "id": "hex", + "params": { + "code": "42" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/n/ff", + "normalized": "/n/ff", + "match": { + "id": "hex", + "params": { + "code": "ff" + } + }, + "resolve": { + "id": "hex", + "params": { + "code": "ff" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/n/4f", + "normalized": "/n/4f", + "match": { + "id": "hex", + "params": { + "code": "4f" + } + }, + "resolve": { + "id": "hex", + "params": { + "code": "4f" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/n/zz", + "normalized": "/n/zz", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "H07-exact-vs-catch-all", + "note": "exact route at /files, catch-all below it, decoded captures", + "declarations": [ + { + "id": "exact", + "method": "GET", + "pattern": "/files", + "transport": "buffer" + }, + { + "id": "rest", + "method": "GET", + "pattern": "/files/:rest*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/files" + }, + { + "method": "GET", + "raw": "/files/" + }, + { + "method": "GET", + "raw": "/files/a%2Fb" + }, + { + "method": "GET", + "raw": "/files/a/b/c" + }, + { + "method": "GET", + "raw": "/files/a%20b/c%2Fd" + }, + { + "method": "HEAD", + "raw": "/files/x" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/files", + "normalized": "/files", + "match": { + "id": "exact", + "params": {} + }, + "resolve": { + "id": "exact", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/files/", + "normalized": "/files", + "match": { + "id": "exact", + "params": {} + }, + "resolve": { + "id": "exact", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/files/a%2Fb", + "normalized": "/files/a%2Fb", + "match": { + "id": "rest", + "params": { + "rest": "a/b" + } + }, + "resolve": { + "id": "rest", + "params": { + "rest": "a/b" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/files/a/b/c", + "normalized": "/files/a/b/c", + "match": { + "id": "rest", + "params": { + "rest": "a/b/c" + } + }, + "resolve": { + "id": "rest", + "params": { + "rest": "a/b/c" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/files/a%20b/c%2Fd", + "normalized": "/files/a%20b/c%2Fd", + "match": { + "id": "rest", + "params": { + "rest": "a b/c/d" + } + }, + "resolve": { + "id": "rest", + "params": { + "rest": "a b/c/d" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/files/x", + "normalized": "/files/x", + "match": null, + "resolve": { + "id": "rest", + "params": { + "rest": "x" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "H08-equal-rank", + "note": "equal-specificity plain params: first registered wins", + "declarations": [ + { + "id": "first", + "method": "GET", + "pattern": "/t/:first", + "transport": "buffer" + }, + { + "id": "second", + "method": "GET", + "pattern": "/t/:second", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/t/x" + }, + { + "method": "GET", + "raw": "/t/x/y" + }, + { + "method": "HEAD", + "raw": "/t/x" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/t/x", + "normalized": "/t/x", + "match": { + "id": "first", + "params": { + "first": "x" + } + }, + "resolve": { + "id": "first", + "params": { + "first": "x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/t/x/y", + "normalized": "/t/x/y", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/t/x", + "normalized": "/t/x", + "match": null, + "resolve": { + "id": "first", + "params": { + "first": "x" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "H09-equal-rank-reversed", + "note": "equal-specificity plain params: first registered wins (declarations reversed)", + "declarations": [ + { + "id": "second", + "method": "GET", + "pattern": "/t/:second", + "transport": "buffer" + }, + { + "id": "first", + "method": "GET", + "pattern": "/t/:first", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/t/x" + }, + { + "method": "GET", + "raw": "/t/x/y" + }, + { + "method": "HEAD", + "raw": "/t/x" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/t/x", + "normalized": "/t/x", + "match": { + "id": "second", + "params": { + "second": "x" + } + }, + "resolve": { + "id": "second", + "params": { + "second": "x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/t/x/y", + "normalized": "/t/x/y", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/t/x", + "normalized": "/t/x", + "match": null, + "resolve": { + "id": "second", + "params": { + "second": "x" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "H10-same-pattern", + "note": "identical pattern text under two declaration IDs (mesh local/remote twins reach the matcher this way)", + "declarations": [ + { + "id": "one", + "method": "GET", + "pattern": "/same", + "transport": "buffer" + }, + { + "id": "two", + "method": "GET", + "pattern": "/same", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/same" + }, + { + "method": "HEAD", + "raw": "/same" + }, + { + "method": "OPTIONS", + "raw": "/same" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/same", + "normalized": "/same", + "match": { + "id": "one", + "params": {} + }, + "resolve": { + "id": "one", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/same", + "normalized": "/same", + "match": null, + "resolve": { + "id": "one", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/same", + "normalized": "/same", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "H11-same-pattern-reversed", + "note": "identical pattern text under two declaration IDs (mesh local/remote twins reach the matcher this way) (declarations reversed)", + "declarations": [ + { + "id": "two", + "method": "GET", + "pattern": "/same", + "transport": "buffer" + }, + { + "id": "one", + "method": "GET", + "pattern": "/same", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/same" + }, + { + "method": "HEAD", + "raw": "/same" + }, + { + "method": "OPTIONS", + "raw": "/same" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/same", + "normalized": "/same", + "match": { + "id": "two", + "params": {} + }, + "resolve": { + "id": "two", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/same", + "normalized": "/same", + "match": null, + "resolve": { + "id": "two", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/same", + "normalized": "/same", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "H12-method-implicit-head", + "note": "buffered GET supplies HEAD; OPTIONS and 405 share one canonical Allow", + "declarations": [ + { + "id": "get", + "method": "GET", + "pattern": "/m", + "transport": "buffer" + }, + { + "id": "post", + "method": "POST", + "pattern": "/m", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/m" + }, + { + "method": "HEAD", + "raw": "/m" + }, + { + "method": "OPTIONS", + "raw": "/m" + }, + { + "method": "POST", + "raw": "/m" + }, + { + "method": "PUT", + "raw": "/m" + }, + { + "method": "DELETE", + "raw": "/m" + }, + { + "method": "PATCH", + "raw": "/m" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/m", + "normalized": "/m", + "match": { + "id": "get", + "params": {} + }, + "resolve": { + "id": "get", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/m", + "normalized": "/m", + "match": null, + "resolve": { + "id": "get", + "params": {}, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/m", + "normalized": "/m", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/m", + "normalized": "/m", + "match": { + "id": "post", + "params": {} + }, + "resolve": { + "id": "post", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/m", + "normalized": "/m", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/m", + "normalized": "/m", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "PATCH", + "raw": "/m", + "normalized": "/m", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + } + ] + }, + { + "id": "H13-method-explicit-head", + "note": "an explicit HEAD wins over the buffered-GET fallback", + "declarations": [ + { + "id": "get", + "method": "GET", + "pattern": "/m", + "transport": "buffer" + }, + { + "id": "post", + "method": "POST", + "pattern": "/m", + "transport": "buffer" + }, + { + "id": "head", + "method": "HEAD", + "pattern": "/m", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/m" + }, + { + "method": "HEAD", + "raw": "/m" + }, + { + "method": "OPTIONS", + "raw": "/m" + }, + { + "method": "POST", + "raw": "/m" + }, + { + "method": "PUT", + "raw": "/m" + }, + { + "method": "DELETE", + "raw": "/m" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/m", + "normalized": "/m", + "match": { + "id": "get", + "params": {} + }, + "resolve": { + "id": "get", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/m", + "normalized": "/m", + "match": { + "id": "head", + "params": {} + }, + "resolve": { + "id": "head", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/m", + "normalized": "/m", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/m", + "normalized": "/m", + "match": { + "id": "post", + "params": {} + }, + "resolve": { + "id": "post", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "PUT", + "raw": "/m", + "normalized": "/m", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + }, + { + "method": "DELETE", + "raw": "/m", + "normalized": "/m", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "POST", + "OPTIONS" + ] + } + ] + }, + { + "id": "H14-streaming-head", + "note": "a streaming GET does not supply HEAD", + "declarations": [ + { + "id": "stream", + "method": "GET", + "pattern": "/stream", + "transport": "sse" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/stream" + }, + { + "method": "HEAD", + "raw": "/stream" + }, + { + "method": "OPTIONS", + "raw": "/stream" + }, + { + "method": "POST", + "raw": "/stream" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/stream", + "normalized": "/stream", + "match": { + "id": "stream", + "params": {} + }, + "resolve": { + "id": "stream", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/stream", + "normalized": "/stream", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/stream", + "normalized": "/stream", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/stream", + "normalized": "/stream", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + } + ] + }, + { + "id": "H15-streaming-outranks-buffered", + "note": "HEAD skips a higher-ranked streaming GET and falls back to a lower-ranked buffered GET", + "declarations": [ + { + "id": "live", + "method": "GET", + "pattern": "/s/live", + "transport": "sse" + }, + { + "id": "byId", + "method": "GET", + "pattern": "/s/:id", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/s/live" + }, + { + "method": "HEAD", + "raw": "/s/live" + }, + { + "method": "OPTIONS", + "raw": "/s/live" + }, + { + "method": "HEAD", + "raw": "/s/x" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/s/live", + "normalized": "/s/live", + "match": { + "id": "live", + "params": {} + }, + "resolve": { + "id": "live", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/s/live", + "normalized": "/s/live", + "match": null, + "resolve": { + "id": "byId", + "params": { + "id": "live" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/s/live", + "normalized": "/s/live", + "match": null, + "resolve": null, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/s/x", + "normalized": "/s/x", + "match": null, + "resolve": { + "id": "byId", + "params": { + "id": "x" + }, + "implicitHead": true + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "H16-negotiate-and-ndjson-head", + "note": "negotiate and ndjson GETs are streaming transports for the HEAD rule", + "declarations": [ + { + "id": "negotiate", + "method": "GET", + "pattern": "/neg", + "transport": "negotiate" + }, + { + "id": "ndjson", + "method": "GET", + "pattern": "/nd", + "transport": "ndjson" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/neg" + }, + { + "method": "HEAD", + "raw": "/neg" + }, + { + "method": "OPTIONS", + "raw": "/neg" + }, + { + "method": "HEAD", + "raw": "/nd" + }, + { + "method": "OPTIONS", + "raw": "/nd" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/neg", + "normalized": "/neg", + "match": { + "id": "negotiate", + "params": {} + }, + "resolve": { + "id": "negotiate", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/neg", + "normalized": "/neg", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/neg", + "normalized": "/neg", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/nd", + "normalized": "/nd", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + }, + { + "method": "OPTIONS", + "raw": "/nd", + "normalized": "/nd", + "match": null, + "resolve": null, + "allow": [ + "GET", + "OPTIONS" + ] + } + ] + }, + { + "id": "H17-allow-order", + "note": "Allow is canonical regardless of declaration order; explicit OPTIONS is a normal route", + "declarations": [ + { + "id": "delete", + "method": "DELETE", + "pattern": "/r", + "transport": "buffer" + }, + { + "id": "patch", + "method": "PATCH", + "pattern": "/r", + "transport": "buffer" + }, + { + "id": "options", + "method": "OPTIONS", + "pattern": "/r", + "transport": "buffer" + }, + { + "id": "put", + "method": "PUT", + "pattern": "/r", + "transport": "buffer" + }, + { + "id": "get", + "method": "GET", + "pattern": "/r", + "transport": "sse" + }, + { + "id": "post", + "method": "POST", + "pattern": "/r", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "OPTIONS", + "raw": "/r" + }, + { + "method": "HEAD", + "raw": "/r" + }, + { + "method": "GET", + "raw": "/r" + }, + { + "method": "TRACE", + "raw": "/r" + }, + { + "method": "POST", + "raw": "/r" + } + ], + "outcomes": [ + { + "method": "OPTIONS", + "raw": "/r", + "normalized": "/r", + "match": { + "id": "options", + "params": {} + }, + "resolve": { + "id": "options", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "HEAD", + "raw": "/r", + "normalized": "/r", + "match": null, + "resolve": null, + "allow": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/r", + "normalized": "/r", + "match": { + "id": "get", + "params": {} + }, + "resolve": { + "id": "get", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "TRACE", + "raw": "/r", + "normalized": "/r", + "match": null, + "resolve": null, + "allow": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ] + }, + { + "method": "POST", + "raw": "/r", + "normalized": "/r", + "match": { + "id": "post", + "params": {} + }, + "resolve": { + "id": "post", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ] + } + ] + }, + { + "id": "H18-path-miss", + "note": "a path no pattern matches: no route and an empty Allow", + "declarations": [ + { + "id": "a", + "method": "GET", + "pattern": "/a", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/absent" + }, + { + "method": "GET", + "raw": "/a/extra" + }, + { + "method": "GET", + "raw": "/" + }, + { + "method": "OPTIONS", + "raw": "/absent" + }, + { + "method": "HEAD", + "raw": "/absent" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/absent", + "normalized": "/absent", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/a/extra", + "normalized": "/a/extra", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "OPTIONS", + "raw": "/absent", + "normalized": "/absent", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "HEAD", + "raw": "/absent", + "normalized": "/absent", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "H19-encoding-case-unicode", + "note": "decoded params, malformed escapes, repeated slashes, exact case and Unicode literals", + "declarations": [ + { + "id": "userId", + "method": "GET", + "pattern": "/users/:id", + "transport": "buffer" + }, + { + "id": "upper", + "method": "GET", + "pattern": "/Case", + "transport": "buffer" + }, + { + "id": "unicode", + "method": "GET", + "pattern": "/café", + "transport": "buffer" + }, + { + "id": "unicodeParam", + "method": "GET", + "pattern": "/u/:name", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/users/a%20b" + }, + { + "method": "GET", + "raw": "/users/a+b" + }, + { + "method": "GET", + "raw": "/users/%F0%9F%8D%B5" + }, + { + "method": "GET", + "raw": "/users/%E0%A4%A" + }, + { + "method": "GET", + "raw": "/users/%zz" + }, + { + "method": "GET", + "raw": "/a//b" + }, + { + "method": "GET", + "raw": "/users//x" + }, + { + "method": "GET", + "raw": "/Case" + }, + { + "method": "GET", + "raw": "/case" + }, + { + "method": "GET", + "raw": "/CASE" + }, + { + "method": "GET", + "raw": "/café" + }, + { + "method": "GET", + "raw": "/caf%C3%A9" + }, + { + "method": "GET", + "raw": "/u/caf%C3%A9" + }, + { + "method": "GET", + "raw": "/u/café" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/users/a%20b", + "normalized": "/users/a%20b", + "match": { + "id": "userId", + "params": { + "id": "a b" + } + }, + "resolve": { + "id": "userId", + "params": { + "id": "a b" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/users/a+b", + "normalized": "/users/a+b", + "match": { + "id": "userId", + "params": { + "id": "a+b" + } + }, + "resolve": { + "id": "userId", + "params": { + "id": "a+b" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/users/%F0%9F%8D%B5", + "normalized": "/users/%F0%9F%8D%B5", + "match": { + "id": "userId", + "params": { + "id": "🍵" + } + }, + "resolve": { + "id": "userId", + "params": { + "id": "🍵" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/users/%E0%A4%A", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: malformed path encoding" + } + }, + { + "method": "GET", + "raw": "/users/%zz", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: malformed path encoding" + } + }, + { + "method": "GET", + "raw": "/a//b", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "GET", + "raw": "/users//x", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "GET", + "raw": "/Case", + "normalized": "/Case", + "match": { + "id": "upper", + "params": {} + }, + "resolve": { + "id": "upper", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/case", + "normalized": "/case", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/CASE", + "normalized": "/CASE", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/café", + "normalized": "/café", + "match": { + "id": "unicode", + "params": {} + }, + "resolve": { + "id": "unicode", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/caf%C3%A9", + "normalized": "/caf%C3%A9", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/u/caf%C3%A9", + "normalized": "/u/caf%C3%A9", + "match": { + "id": "unicodeParam", + "params": { + "name": "café" + } + }, + "resolve": { + "id": "unicodeParam", + "params": { + "name": "café" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/u/café", + "normalized": "/u/café", + "match": { + "id": "unicodeParam", + "params": { + "name": "café" + } + }, + "resolve": { + "id": "unicodeParam", + "params": { + "name": "café" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "H20-normalization", + "note": "one trailing slash removed; plain and encoded dot segments resolved before lookup", + "declarations": [ + { + "id": "a", + "method": "GET", + "pattern": "/a", + "transport": "buffer" + }, + { + "id": "admin", + "method": "GET", + "pattern": "/admin", + "transport": "buffer" + }, + { + "id": "file", + "method": "GET", + "pattern": "/public/:file", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/a/" + }, + { + "method": "GET", + "raw": "/a//" + }, + { + "method": "GET", + "raw": "/public/../admin" + }, + { + "method": "GET", + "raw": "/public/%2e%2e/admin" + }, + { + "method": "GET", + "raw": "/public/%2E%2E/admin" + }, + { + "method": "GET", + "raw": "/public/./x" + }, + { + "method": "GET", + "raw": "/a/." + }, + { + "method": "GET", + "raw": "/public/..%2fadmin" + }, + { + "method": "GET", + "raw": "/.." + }, + { + "method": "GET", + "raw": "/a/b/../../admin" + }, + { + "method": "GET", + "raw": "" + }, + { + "method": "GET", + "raw": "a" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/a/", + "normalized": "/a", + "match": { + "id": "a", + "params": {} + }, + "resolve": { + "id": "a", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a//", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: repeated slash" + } + }, + { + "method": "GET", + "raw": "/public/../admin", + "normalized": "/admin", + "match": { + "id": "admin", + "params": {} + }, + "resolve": { + "id": "admin", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/public/%2e%2e/admin", + "normalized": "/admin", + "match": { + "id": "admin", + "params": {} + }, + "resolve": { + "id": "admin", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/public/%2E%2E/admin", + "normalized": "/admin", + "match": { + "id": "admin", + "params": {} + }, + "resolve": { + "id": "admin", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/public/./x", + "normalized": "/public/x", + "match": { + "id": "file", + "params": { + "file": "x" + } + }, + "resolve": { + "id": "file", + "params": { + "file": "x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/.", + "normalized": "/a", + "match": { + "id": "a", + "params": {} + }, + "resolve": { + "id": "a", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/public/..%2fadmin", + "normalized": "/public/..%2fadmin", + "match": { + "id": "file", + "params": { + "file": "../admin" + } + }, + "resolve": { + "id": "file", + "params": { + "file": "../admin" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/..", + "normalized": "/", + "match": null, + "resolve": null, + "allow": [] + }, + { + "method": "GET", + "raw": "/a/b/../../admin", + "normalized": "/admin", + "match": { + "id": "admin", + "params": {} + }, + "resolve": { + "id": "admin", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: path must start with slash" + } + }, + { + "method": "GET", + "raw": "a", + "error": { + "name": "InvalidRequestPathError", + "message": "invalid request path: path must start with slash" + } + } + ] + }, + { + "id": "H21-root", + "note": "the root pattern and a root catch-all", + "declarations": [ + { + "id": "any", + "method": "GET", + "pattern": "/:rest*", + "transport": "buffer" + }, + { + "id": "root", + "method": "GET", + "pattern": "/", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/" + }, + { + "method": "GET", + "raw": "/x" + }, + { + "method": "GET", + "raw": "/x/y" + }, + { + "method": "GET", + "raw": "/x/" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/", + "normalized": "/", + "match": { + "id": "root", + "params": {} + }, + "resolve": { + "id": "root", + "params": {}, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x", + "normalized": "/x", + "match": { + "id": "any", + "params": { + "rest": "x" + } + }, + "resolve": { + "id": "any", + "params": { + "rest": "x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x/y", + "normalized": "/x/y", + "match": { + "id": "any", + "params": { + "rest": "x/y" + } + }, + "resolve": { + "id": "any", + "params": { + "rest": "x/y" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/x/", + "normalized": "/x", + "match": { + "id": "any", + "params": { + "rest": "x" + } + }, + "resolve": { + "id": "any", + "params": { + "rest": "x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "H22-first-differing-segment", + "note": "ranking is decided at the first segment whose kind differs", + "declarations": [ + { + "id": "paramStatic", + "method": "GET", + "pattern": "/a/:x/c", + "transport": "buffer" + }, + { + "id": "staticParam", + "method": "GET", + "pattern": "/a/b/:y", + "transport": "buffer" + }, + { + "id": "paramConstrained", + "method": "GET", + "pattern": "/a/:x/:y(\\d+)", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/a/b/c" + }, + { + "method": "GET", + "raw": "/a/z/c" + }, + { + "method": "GET", + "raw": "/a/z/5" + }, + { + "method": "GET", + "raw": "/a/b/5" + }, + { + "method": "GET", + "raw": "/a/z/q" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/a/b/c", + "normalized": "/a/b/c", + "match": { + "id": "staticParam", + "params": { + "y": "c" + } + }, + "resolve": { + "id": "staticParam", + "params": { + "y": "c" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/z/c", + "normalized": "/a/z/c", + "match": { + "id": "paramStatic", + "params": { + "x": "z" + } + }, + "resolve": { + "id": "paramStatic", + "params": { + "x": "z" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/z/5", + "normalized": "/a/z/5", + "match": { + "id": "paramConstrained", + "params": { + "x": "z", + "y": "5" + } + }, + "resolve": { + "id": "paramConstrained", + "params": { + "x": "z", + "y": "5" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/b/5", + "normalized": "/a/b/5", + "match": { + "id": "staticParam", + "params": { + "y": "5" + } + }, + "resolve": { + "id": "staticParam", + "params": { + "y": "5" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/z/q", + "normalized": "/a/z/q", + "match": null, + "resolve": null, + "allow": [] + } + ] + }, + { + "id": "H23-per-position-decode", + "note": "a decoded value is the same for every candidate the scan reaches", + "declarations": [ + { + "id": "zzz", + "method": "GET", + "pattern": "/a/:x/zzz", + "transport": "buffer" + }, + { + "id": "b", + "method": "GET", + "pattern": "/a/:y/b", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/a/a%20b/b" + }, + { + "method": "GET", + "raw": "/a/a%20b/zzz" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/a/a%20b/b", + "normalized": "/a/a%20b/b", + "match": { + "id": "b", + "params": { + "y": "a b" + } + }, + "resolve": { + "id": "b", + "params": { + "y": "a b" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/a/a%20b/zzz", + "normalized": "/a/a%20b/zzz", + "match": { + "id": "zzz", + "params": { + "x": "a b" + } + }, + "resolve": { + "id": "zzz", + "params": { + "x": "a b" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + } + ] + }, + { + "id": "H24-constrained-catch-all", + "note": "two catch-alls ranked by the segments before them", + "declarations": [ + { + "id": "named", + "method": "GET", + "pattern": "/v/:name/:rest*", + "transport": "buffer" + }, + { + "id": "versioned", + "method": "GET", + "pattern": "/v/:ver(\\d+)/:rest*", + "transport": "buffer" + } + ], + "requests": [ + { + "method": "GET", + "raw": "/v/1/x" + }, + { + "method": "GET", + "raw": "/v/a/x" + }, + { + "method": "GET", + "raw": "/v/1" + }, + { + "method": "GET", + "raw": "/v" + } + ], + "outcomes": [ + { + "method": "GET", + "raw": "/v/1/x", + "normalized": "/v/1/x", + "match": { + "id": "versioned", + "params": { + "ver": "1", + "rest": "x" + } + }, + "resolve": { + "id": "versioned", + "params": { + "ver": "1", + "rest": "x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/v/a/x", + "normalized": "/v/a/x", + "match": { + "id": "named", + "params": { + "name": "a", + "rest": "x" + } + }, + "resolve": { + "id": "named", + "params": { + "name": "a", + "rest": "x" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/v/1", + "normalized": "/v/1", + "match": { + "id": "versioned", + "params": { + "ver": "1", + "rest": "" + } + }, + "resolve": { + "id": "versioned", + "params": { + "ver": "1", + "rest": "" + }, + "implicitHead": false + }, + "allow": [ + "GET", + "HEAD", + "OPTIONS" + ] + }, + { + "method": "GET", + "raw": "/v", + "normalized": "/v", + "match": null, + "resolve": null, + "allow": [] + } + ] + } + ] +} diff --git a/test/router-parity/frozen/matcher-ws.json b/test/router-parity/frozen/matcher-ws.json new file mode 100644 index 0000000..6e513ba --- /dev/null +++ b/test/router-parity/frozen/matcher-ws.json @@ -0,0 +1,214 @@ +{ + "revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a", + "data": [ + { + "id": "W01-overlap", + "declarations": [ + { + "id": "param", + "pattern": "/ws/:id" + }, + { + "id": "static", + "pattern": "/ws/static" + }, + { + "id": "rest", + "pattern": "/ws/:rest*" + } + ], + "outcomes": [ + { + "path": "/ws/static", + "route": { + "id": "param", + "params": { + "id": "static" + } + } + }, + { + "path": "/ws/x", + "route": { + "id": "param", + "params": { + "id": "x" + } + } + }, + { + "path": "/ws/a%20b", + "route": { + "id": "param", + "params": { + "id": "a b" + } + } + }, + { + "path": "/ws", + "route": { + "id": "rest", + "params": { + "rest": "" + } + } + }, + { + "path": "/ws/x/y", + "route": { + "id": "rest", + "params": { + "rest": "x/y" + } + } + }, + { + "path": "/w", + "route": null + }, + { + "path": "/w/a%2Fb/c", + "route": null + }, + { + "path": "/nope", + "route": null + } + ] + }, + { + "id": "W02-overlap-reversed", + "declarations": [ + { + "id": "rest", + "pattern": "/ws/:rest*" + }, + { + "id": "static", + "pattern": "/ws/static" + }, + { + "id": "param", + "pattern": "/ws/:id" + } + ], + "outcomes": [ + { + "path": "/ws/static", + "route": { + "id": "rest", + "params": { + "rest": "static" + } + } + }, + { + "path": "/ws/x", + "route": { + "id": "rest", + "params": { + "rest": "x" + } + } + }, + { + "path": "/ws/a%20b", + "route": { + "id": "rest", + "params": { + "rest": "a b" + } + } + }, + { + "path": "/ws", + "route": { + "id": "rest", + "params": { + "rest": "" + } + } + }, + { + "path": "/ws/x/y", + "route": { + "id": "rest", + "params": { + "rest": "x/y" + } + } + }, + { + "path": "/w", + "route": null + }, + { + "path": "/w/a%2Fb/c", + "route": null + }, + { + "path": "/nope", + "route": null + } + ] + }, + { + "id": "W03-catch-all-first", + "declarations": [ + { + "id": "rest", + "pattern": "/w/:rest*" + }, + { + "id": "exact", + "pattern": "/w" + } + ], + "outcomes": [ + { + "path": "/ws/static", + "route": null + }, + { + "path": "/ws/x", + "route": null + }, + { + "path": "/ws/a%20b", + "route": null + }, + { + "path": "/ws", + "route": null + }, + { + "path": "/ws/x/y", + "route": null + }, + { + "path": "/w", + "route": { + "id": "rest", + "params": { + "rest": "" + } + } + }, + { + "path": "/w/a%2Fb/c", + "route": { + "id": "rest", + "params": { + "rest": "a/b/c" + } + } + }, + { + "path": "/nope", + "route": null + } + ] + } + ] +} diff --git a/test/router-parity/frozen/ws-app-upgrade.json b/test/router-parity/frozen/ws-app-upgrade.json new file mode 100644 index 0000000..4b5c521 --- /dev/null +++ b/test/router-parity/frozen/ws-app-upgrade.json @@ -0,0 +1,151 @@ +{ + "revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a", + "data": [ + { + "path": "/live/lobby", + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "lobby" + } + } + ], + "closes": [ + {} + ] + }, + { + "path": "/live/kitchen", + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "kitchen" + } + } + ], + "closes": [ + {} + ] + }, + { + "path": "/live/lobby/", + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "lobby" + } + } + ], + "closes": [ + {} + ] + }, + { + "path": "/live/x/../lobby", + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "lobby" + } + } + ], + "closes": [ + {} + ] + }, + { + "path": "/live/a%20b", + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "a b" + } + } + ], + "closes": [ + {} + ] + }, + { + "path": "/live/lobby?x=1", + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "lobby" + } + } + ], + "closes": [ + {} + ] + }, + { + "path": "/live/%E0%A4%A", + "sent": [], + "closes": [ + { + "code": 1008, + "reason": "invalid request path" + } + ] + }, + { + "path": "/live//lobby", + "sent": [], + "closes": [ + { + "code": 1008, + "reason": "invalid request path" + } + ] + }, + { + "path": "/plain", + "sent": [], + "closes": [ + { + "code": 1008, + "reason": "no matching ws route" + } + ] + }, + { + "path": "/nope", + "sent": [], + "closes": [ + { + "code": 1008, + "reason": "no matching ws route" + } + ] + }, + { + "path": "/feed", + "sent": [ + { + "id": "feed", + "params": {} + } + ], + "closes": [ + {} + ] + }, + { + "path": "/__mesh__/control", + "sent": [], + "closes": [ + { + "code": 1008, + "reason": "mesh control channel not enabled: this app exports nothing, or has no mesh.secret" + } + ] + } + ] +} diff --git a/test/router-parity/frozen/ws-http-same-path.json b/test/router-parity/frozen/ws-http-same-path.json new file mode 100644 index 0000000..4e61ae1 --- /dev/null +++ b/test/router-parity/frozen/ws-http-same-path.json @@ -0,0 +1,40 @@ +{ + "revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a", + "data": [ + { + "method": "GET", + "path": "/live/lobby", + "status": 405, + "allow": "POST, OPTIONS", + "body": "{\"error\":\"Method Not Allowed\"}" + }, + { + "method": "POST", + "path": "/live/lobby", + "status": 200, + "allow": null, + "body": "{\"id\":\"httpLobby\"}" + }, + { + "method": "OPTIONS", + "path": "/live/lobby", + "status": 204, + "allow": "POST, OPTIONS", + "body": "" + }, + { + "method": "GET", + "path": "/live/kitchen", + "status": 404, + "allow": null, + "body": "{\"error\":\"Not Found\"}" + }, + { + "method": "GET", + "path": "/feed", + "status": 200, + "allow": null, + "body": "{\"id\":\"feed\",\"params\":{}}\n" + } + ] +} diff --git a/test/router-parity/frozen/ws-node-upgrade.json b/test/router-parity/frozen/ws-node-upgrade.json new file mode 100644 index 0000000..df82268 --- /dev/null +++ b/test/router-parity/frozen/ws-node-upgrade.json @@ -0,0 +1,149 @@ +{ + "revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a", + "data": [ + { + "path": "/live/lobby", + "status": 101, + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "lobby" + } + } + ], + "close": { + "code": 1005, + "reason": "" + } + }, + { + "path": "/live/kitchen", + "status": 101, + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "kitchen" + } + } + ], + "close": { + "code": 1005, + "reason": "" + } + }, + { + "path": "/live/lobby/", + "status": 101, + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "lobby" + } + } + ], + "close": { + "code": 1005, + "reason": "" + } + }, + { + "path": "/live/x/../lobby", + "status": 101, + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "lobby" + } + } + ], + "close": { + "code": 1005, + "reason": "" + } + }, + { + "path": "/live/a%20b", + "status": 101, + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "a b" + } + } + ], + "close": { + "code": 1005, + "reason": "" + } + }, + { + "path": "/live/lobby?x=1", + "status": 101, + "sent": [ + { + "id": "liveRoom", + "params": { + "room": "lobby" + } + } + ], + "close": { + "code": 1005, + "reason": "" + } + }, + { + "path": "/live/%E0%A4%A", + "status": 400, + "sent": [] + }, + { + "path": "/live//lobby", + "status": 400, + "sent": [] + }, + { + "path": "/plain", + "status": 404, + "sent": [] + }, + { + "path": "/nope", + "status": 404, + "sent": [] + }, + { + "path": "/feed", + "status": 101, + "sent": [ + { + "id": "feed", + "params": {} + } + ], + "close": { + "code": 1005, + "reason": "" + } + }, + { + "path": "/__mesh__/control", + "status": 101, + "sent": [ + { + "id": "reserved", + "params": {} + } + ], + "close": { + "code": 1005, + "reason": "" + } + } + ] +} diff --git a/test/router-parity/generator.ts b/test/router-parity/generator.ts new file mode 100644 index 0000000..efa3a02 --- /dev/null +++ b/test/router-parity/generator.ts @@ -0,0 +1,121 @@ +/** + * Fixed-seed route/path generator for the differential corpus. + * + * Its output is versioned with the fixture: `frozen/matcher-generated.json` stores the seed, the + * rules below and every generated declaration and request. The test regenerates from the seed and + * requires the result to equal the stored inputs, so a change to this file cannot quietly move the + * baseline — it fails until someone deliberately starts a new generator version. + * + * Do not edit GENERATOR_V1. A new generator is a new version with its own frozen file. + */ +import { compilePattern } from './oracle'; +import type { Declaration, Request, Scenario, Transport } from './matcher'; + +export const GENERATOR_SEED = 10908; +export const GENERATOR_VERSION = 'router-parity-gen-v1'; + +export const GENERATOR_RULES = [ + 'PRNG: mulberry32(seed); every choice below draws from it in program order.', + '40 scenarios; each has 2-10 declarations and 12 requests.', + 'Declaration: 0-3 segments, each static (a|b|c|x, p=0.5), plain param (p=0.25) or constrained param (p=0.25) ' + + 'using one of \\d+ | [a-c]+ | [0-9a-f]{2}; then a final catch-all with p=0.2. Param names are p.', + 'Declaration method from GET x3, POST, PUT, DELETE, PATCH, HEAD, OPTIONS. A GET is buffer with p=0.7, else ' + + 'sse | ndjson | negotiate; every other method is buffer.', + 'Request path: p=0.6 instantiate a random declaration (static -> its literal, param -> value pool, catch-all -> ' + + '0-2 pool values), else 0-4 random pool segments. Value pool: a b c x 7 42 ff 0a a%20b caf%C3%A9 %34%32.', + 'Request decoration: trailing slash p=0.15, a dot segment (/./ or /q/../) inserted p=0.1, a repeated slash p=0.05.', + 'Request method from GET x2, HEAD, POST, PUT, DELETE, PATCH, OPTIONS.', + 'Unsupported patterns are never produced: every generated pattern must pass compilePattern.', +]; + +const STATICS = ['a', 'b', 'c', 'x']; +const CONSTRAINTS = ['\\d+', '[a-c]+', '[0-9a-f]{2}']; +const VALUES = ['a', 'b', 'c', 'x', '7', '42', 'ff', '0a', 'a%20b', 'caf%C3%A9', '%34%32']; +const DECL_METHODS = ['GET', 'GET', 'GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS']; +const STREAMING: Transport[] = ['sse', 'ndjson', 'negotiate']; +const REQUEST_METHODS = ['GET', 'GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS']; + +type Rng = () => number; + +function mulberry32(seed: number): Rng { + let state = seed >>> 0; + return () => { + state = (state + 0x6d2b79f5) >>> 0; + let t = state; + t = Math.imul(t ^ (t >>> 15), t | 1); + t ^= t + Math.imul(t ^ (t >>> 7), t | 61); + return ((t ^ (t >>> 14)) >>> 0) / 4294967296; + }; +} + +const pick = (rng: Rng, items: readonly T[]): T => items[Math.floor(rng() * items.length)]; +const int = (rng: Rng, min: number, max: number): number => min + Math.floor(rng() * (max - min + 1)); + +function patternSegment(rng: Rng, index: number): string { + const roll = rng(); + if (roll < 0.5) return pick(rng, STATICS); + if (roll < 0.75) return `:p${index}`; + return `:p${index}(${pick(rng, CONSTRAINTS)})`; +} + +function declaration(rng: Rng, id: string): Declaration { + const depth = int(rng, 0, 3); + const segments = Array.from({ length: depth }, (_, index) => patternSegment(rng, index)); + if (rng() < 0.2) segments.push(`:p${depth}*`); + + const method = pick(rng, DECL_METHODS); + const transport: Transport = method === 'GET' && rng() >= 0.7 ? pick(rng, STREAMING) : 'buffer'; + const pattern = `/${segments.join('/')}`; + compilePattern(pattern); // throws if a rule above ever produced an unsupported pattern + return { id, method, pattern, transport }; +} + +function instantiate(rng: Rng, decl: Declaration): string[] { + const segments: string[] = []; + + for (const segment of decl.pattern.split('/').slice(1)) { + if (!segment) continue; + if (segment.endsWith('*')) { + const count = int(rng, 0, 2); + for (let index = 0; index < count; index++) segments.push(pick(rng, VALUES)); + } else { + segments.push(segment.startsWith(':') ? pick(rng, VALUES) : segment); + } + } + + return segments; +} + +function decorate(rng: Rng, segments: string[]): string { + let path = `/${segments.join('/')}`; + if (rng() < 0.15 && path !== '/') path += '/'; + + if (rng() < 0.1) { + const at = int(rng, 0, segments.length); + const dots = rng() < 0.5 ? ['.'] : ['q', '..']; + const withDots = [...segments.slice(0, at), ...dots, ...segments.slice(at)]; + path = `/${withDots.join('/')}`; + } + + if (rng() < 0.05) path = path.replace('/', '//'); + return path; +} + +function request(rng: Rng, declarations: Declaration[]): Request { + const segments = + rng() < 0.6 + ? instantiate(rng, pick(rng, declarations)) + : Array.from({ length: int(rng, 0, 4) }, () => pick(rng, VALUES)); + return { method: pick(rng, REQUEST_METHODS), raw: decorate(rng, segments) }; +} + +export function generateScenarios(seed: number = GENERATOR_SEED): Scenario[] { + const rng = mulberry32(seed); + + return Array.from({ length: 40 }, (_, index): Scenario => { + const id = `G${String(index + 1).padStart(2, '0')}`; + const declarations = Array.from({ length: int(rng, 2, 10) }, (_, d) => declaration(rng, `${id}.d${d + 1}`)); + const requests = Array.from({ length: 12 }, () => request(rng, declarations)); + return { id, note: `generated by ${GENERATOR_VERSION}, seed ${seed}`, declarations, requests }; + }); +} diff --git a/test/router-parity/matcher.test.ts b/test/router-parity/matcher.test.ts new file mode 100644 index 0000000..67a0772 --- /dev/null +++ b/test/router-parity/matcher.test.ts @@ -0,0 +1,116 @@ +/** + * Differential matcher parity (CARD-08 → CARD-07, #109). + * + * Every scenario runs through the frozen oracle and through the live `src/http/router` exports, and + * both must equal the outputs captured at the pinned revision. Today the live router *is* the + * linear matcher, so this proves the oracle is a faithful copy; once CARD-07 swaps the internals + * for a radix index behind the same exports, the same test compares oracle against radix with no + * edit here. + */ +import { describe, it, expect, beforeAll } from 'vitest'; +import * as live from '../../src/http/router'; +import { matchWsRoute as liveMatchWsRoute } from '../../src/http/ws-core'; +import type { WsRouteDef } from '../../src/http/types'; +import * as oracle from './oracle'; +import { runScenario, type MatcherImpl, type Outcome, type Scenario } from './matcher'; +import { HAND_SCENARIOS } from './cases'; +import { generateScenarios, GENERATOR_RULES, GENERATOR_SEED, GENERATOR_VERSION } from './generator'; +import { frozen, expectFrozenEqual } from './frozen'; + +const LIVE: MatcherImpl = live; +const ORACLE: MatcherImpl = oracle; + +interface CapturedScenario extends Scenario { + outcomes: Outcome[]; +} + +interface GeneratedFile { + generator: string; + seed: number; + rules: string[]; + scenarios: CapturedScenario[]; +} + +const capture = (scenarios: Scenario[]): CapturedScenario[] => + scenarios.map((scenario) => ({ ...scenario, outcomes: runScenario(LIVE, scenario) })); + +function checkScenario(scenario: Scenario, expected: CapturedScenario | undefined): void { + expect(expected, `${scenario.id} is missing from the frozen fixture`).toBeDefined(); + const { outcomes, ...inputs } = expected!; + expectFrozenEqual(scenario, inputs, `${scenario.id} inputs`); + expectFrozenEqual(runScenario(ORACLE, scenario), outcomes, `${scenario.id} oracle`); + expectFrozenEqual(runScenario(LIVE, scenario), outcomes, `${scenario.id} live router`); +} + +describe('router parity: hand-picked matcher cases', () => { + let expected: Map; + + beforeAll(async () => { + const data = await frozen('matcher-hand', () => capture(HAND_SCENARIOS)); + expect(data.map((scenario) => scenario.id)).toEqual(HAND_SCENARIOS.map((scenario) => scenario.id)); + expected = new Map(data.map((scenario) => [scenario.id, scenario])); + }); + + for (const scenario of HAND_SCENARIOS) { + it(`${scenario.id}: ${scenario.note}`, () => checkScenario(scenario, expected.get(scenario.id))); + } +}); + +describe(`router parity: generated matcher cases (${GENERATOR_VERSION}, seed ${GENERATOR_SEED})`, () => { + const generated = generateScenarios(GENERATOR_SEED); + let expected: Map; + + beforeAll(async () => { + const data = await frozen('matcher-generated', () => ({ + generator: GENERATOR_VERSION, + seed: GENERATOR_SEED, + rules: GENERATOR_RULES, + scenarios: capture(generated), + })); + expect({ generator: data.generator, seed: data.seed, rules: data.rules }).toEqual({ + generator: GENERATOR_VERSION, + seed: GENERATOR_SEED, + rules: GENERATOR_RULES, + }); + expect(data.scenarios.map((scenario) => scenario.id)).toEqual(generated.map((scenario) => scenario.id)); + expected = new Map(data.scenarios.map((scenario) => [scenario.id, scenario])); + }); + + for (const scenario of generated) { + it(`${scenario.id}`, () => checkScenario(scenario, expected.get(scenario.id))); + } +}); + +describe('router parity: WebSocket matcher (first registered wins)', () => { + // WS selection is a separate contract from HTTP: no specificity ranking, registration order only. + // Paths are fed already normalized, as both upgrade adapters do since #117. + type WsDecl = WsRouteDef & { id: string }; + type WsMatcher = ( + routes: WsRouteDef[], + path: string, + ) => { def: WsRouteDef; params: Record | undefined } | undefined; + const ws = (id: string, pattern: string): WsDecl => ({ id, pattern, open: async () => (async function* () {})() }); + const overlap = [ws('param', '/ws/:id'), ws('static', '/ws/static'), ws('rest', '/ws/:rest*')]; + const scenarios = [ + { id: 'W01-overlap', routes: overlap }, + { id: 'W02-overlap-reversed', routes: [...overlap].reverse() }, + { id: 'W03-catch-all-first', routes: [ws('rest', '/w/:rest*'), ws('exact', '/w')] }, + ]; + const paths = ['/ws/static', '/ws/x', '/ws/a%20b', '/ws', '/ws/x/y', '/w', '/w/a%2Fb/c', '/nope']; + + const run = (matchWs: WsMatcher) => + scenarios.map(({ id, routes }) => ({ + id, + declarations: routes.map((route) => ({ id: route.id, pattern: route.pattern })), + outcomes: paths.map((path) => { + const hit = matchWs(routes, path); + return { path, route: hit ? { id: (hit.def as WsDecl).id, params: hit.params } : null }; + }), + })); + + it('oracle and live matchWsRoute equal the frozen capture', async () => { + const expected = await frozen('matcher-ws', () => run(liveMatchWsRoute)); + expectFrozenEqual(run(oracle.matchWsRoute), expected, 'ws oracle'); + expectFrozenEqual(run(liveMatchWsRoute), expected, 'ws live'); + }); +}); diff --git a/test/router-parity/matcher.ts b/test/router-parity/matcher.ts new file mode 100644 index 0000000..cfde54b --- /dev/null +++ b/test/router-parity/matcher.ts @@ -0,0 +1,107 @@ +/** + * The differential matcher harness: one ordered declaration array and one request list, run through + * any implementation of the router's lookup functions, reduced to what a caller can observe — + * which declaration answered (by stable ID, never by pattern text), its decoded params, whether HEAD + * was implicit, the ordered `Allow` list, and the normalization error if the path never got that far. + */ +import type { RouteDef } from '../../src/http/types'; + +export type Transport = 'buffer' | 'sse' | 'ndjson' | 'negotiate'; + +export interface Declaration { + id: string; + method: string; + pattern: string; + transport: Transport; +} + +export interface Request { + method: string; + raw: string; +} + +export interface Scenario { + id: string; + note: string; + declarations: Declaration[]; + requests: Request[]; +} + +/** The lookup surface CARD-07 replaces. The live router and the frozen oracle both satisfy it. */ +export interface MatcherImpl { + normalizeRequestPath(path: string): string; + matchRoute( + routes: RouteDef[], + method: string, + path: string, + ): { def: unknown; params: Record } | undefined; + resolveRoute( + routes: RouteDef[], + method: string, + path: string, + ): { def: unknown; params: Record; implicitHead: boolean } | undefined; + allowedMethods(routes: RouteDef[], path: string): string[]; +} + +export interface ErrorOutcome { + name: string; + message: string; +} + +export interface Outcome { + method: string; + raw: string; + normalized?: string; + error?: ErrorOutcome; + match?: { id: string; params: Record } | null; + resolve?: { id: string; params: Record; implicitHead: boolean } | null; + allow?: string[]; +} + +export function errorOutcome(error: unknown): ErrorOutcome { + const err = error as Error; + return { name: err.name, message: err.message }; +} + +/** Builds fresh `RouteDef` objects for one run, so no implementation can see another's cached table. */ +function buildRoutes(declarations: Declaration[]): { routes: RouteDef[]; idOf: Map } { + const idOf = new Map(); + const routes = declarations.map((decl): RouteDef => { + const def: RouteDef = { + method: decl.method, + pattern: decl.pattern, + transport: decl.transport, + handler: async () => ({ status: 200, headers: {}, body: decl.id }), + }; + idOf.set(def, decl.id); + return def; + }); + return { routes, idOf }; +} + +export function runScenario(impl: MatcherImpl, scenario: Scenario): Outcome[] { + const { routes, idOf } = buildRoutes(scenario.declarations); + const id = (def: unknown): string => idOf.get(def) ?? ''; + + return scenario.requests.map(({ method, raw }): Outcome => { + let normalized: string; + + try { + normalized = impl.normalizeRequestPath(raw); + } catch (error) { + return { method, raw, error: errorOutcome(error) }; + } + + const match = impl.matchRoute(routes, method, normalized); + const resolved = impl.resolveRoute(routes, method, normalized); + + return { + method, + raw, + normalized, + match: match ? { id: id(match.def), params: match.params } : null, + resolve: resolved ? { id: id(resolved.def), params: resolved.params, implicitHead: resolved.implicitHead } : null, + allow: impl.allowedMethods(routes, normalized), + }; + }); +} diff --git a/test/router-parity/ws.test.ts b/test/router-parity/ws.test.ts new file mode 100644 index 0000000..f3bb3a1 --- /dev/null +++ b/test/router-parity/ws.test.ts @@ -0,0 +1,183 @@ +/** + * WebSocket upgrade parity, kept apart from HTTP on purpose: WS selection is first-registered-wins + * with no specificity ranking, an HTTP route at the same path never takes the upgrade, and the mesh + * control path is checked before WS route matching. Captured through both upgrade entry points — + * `app.upgrade` (Deno/Bun/edge) and the Node `server.on('upgrade')` listener — because they are + * separate code paths and do not agree on everything (see the reserved-path rows in the fixture). + */ +import 'reflect-metadata'; +import type { AddressInfo } from 'net'; +import WebSocket from 'ws'; +import { describe, it, beforeAll, afterAll } from 'vitest'; +import { createApp, Route, Get, Post, Ws, Stream, Module, param } from '../../src/index'; +import { channel } from '../../src/channel'; +import type { App } from '../../src/app/types'; +import type { WsRequest, WsSocket } from '../../src/http/ws-core'; +import { frozen, expectFrozenEqual } from './frozen'; + +const announce = (id: string, params: Record) => + (async function* () { + yield { id, params }; + })(); + +@Route('/') +class ParityWs { + // Registered before the static twin: WS does not rank, so this one answers /live/lobby. + @Ws('/live/:room') liveRoom(@param() p: Record) { + return announce('liveRoom', p); + } + @Ws('/live/lobby') liveLobby(@param() p: Record) { + return announce('liveLobby', p); + } + // Same path as the WS routes, different method, so the boot accepts it; it must not take upgrades. + @Post('/live/lobby') httpLobby() { + return { id: 'httpLobby' }; + } + @Get('/plain') plain() { + return { id: 'plain' }; + } + // `negotiate` routes are registered for both HTTP and WS. + @Stream('/feed') feed() { + return announce('feed', {}); + } + // A user route on the reserved mesh path, on an app with no mesh: the two adapters disagree here. + @Ws('/__mesh__/control') reserved(@param() p: Record) { + return announce('reserved', p); + } +} + +@Module({ mountpoint: '/', controllers: [ParityWs] }) +class ParityWsModule {} + +// The `ws` client runs its URL through the URL parser, so on the Node rows dot segments are already +// resolved before the server sees them; `app.upgrade` receives each path exactly as written here. +const UPGRADE_PATHS = [ + '/live/lobby', + '/live/kitchen', + '/live/lobby/', + '/live/x/../lobby', + '/live/a%20b', + '/live/lobby?x=1', + '/live/%E0%A4%A', + '/live//lobby', + '/plain', + '/nope', + '/feed', + '/__mesh__/control', +]; + +const HTTP_REQUESTS: Array<[string, string]> = [ + ['GET', '/live/lobby'], + ['POST', '/live/lobby'], + ['OPTIONS', '/live/lobby'], + ['GET', '/live/kitchen'], + ['GET', '/feed'], +]; + +interface UpgradeOutcome { + path: string; + sent: unknown[]; + closes: Array<{ code?: number; reason?: string }>; +} + +async function viaAppUpgrade(app: App, path: string): Promise { + const inbound = channel(); + const ac = new AbortController(); + const sent: unknown[] = []; + const closes: Array<{ code?: number; reason?: string }> = []; + let open = true; + const socket: WsSocket = { + inbound, + abort: ac.signal, + get isOpen() { + return open; + }, + send: (data) => sent.push(JSON.parse(data)), + close: (code, reason) => { + open = false; + closes.push({ code, reason }); + ac.abort(); + }, + terminate: () => { + open = false; + ac.abort(); + }, + }; + const request: WsRequest = { url: path, headers: {}, protocol: 'http', ip: '127.0.0.1' }; + await app.upgrade(request, socket); + return { path, sent, closes }; +} + +interface NodeUpgradeOutcome { + path: string; + status?: number; + sent: unknown[]; + close?: { code: number; reason: string }; +} + +function viaNodeUpgrade(port: number, path: string): Promise { + return new Promise((resolve) => { + const sent: unknown[] = []; + const client = new WebSocket(`ws://127.0.0.1:${port}${path}`); + client.on('unexpected-response', (_req, res) => { + resolve({ path, status: res.statusCode, sent }); + res.resume(); + client.terminate(); + }); + client.on('message', (data) => sent.push(JSON.parse(String(data)))); + client.on('close', (code, reason) => resolve({ path, status: 101, sent, close: { code, reason: String(reason) } })); + client.on('error', () => { + /* reported through unexpected-response or close */ + }); + }); +} + +describe('router parity: WebSocket upgrade outcomes', () => { + let app: App; + let nodeApp: App; + let port: number; + + beforeAll(async () => { + app = createApp({ modules: [ParityWsModule] }); + nodeApp = createApp({ modules: [ParityWsModule] }); + const server = await nodeApp.listen(0); + port = (server.address() as AddressInfo).port; + }); + + afterAll(async () => { + await nodeApp.close(); + }); + + it('app.upgrade outcomes equal the frozen capture', async () => { + const run = async () => { + const out: UpgradeOutcome[] = []; + for (const path of UPGRADE_PATHS) out.push(await viaAppUpgrade(app, path)); + return out; + }; + const expected = await frozen('ws-app-upgrade', run); + expectFrozenEqual(await run(), expected, 'app.upgrade'); + }); + + it('Node upgrade listener outcomes equal the frozen capture', async () => { + const run = async () => { + const out: NodeUpgradeOutcome[] = []; + for (const path of UPGRADE_PATHS) out.push(await viaNodeUpgrade(port, path)); + return out; + }; + const expected = await frozen('ws-node-upgrade', run); + expectFrozenEqual(await run(), expected, 'node upgrade'); + }); + + it('plain HTTP requests at the WS paths equal the frozen capture', async () => { + const run = async () => { + const out: Array<{ method: string; path: string; status: number; allow: string | null; body: string }> = []; + for (const [method, path] of HTTP_REQUESTS) { + const res = await app.fetch(new Request(`http://parity.test${path}`, { method })); + out.push({ method, path, status: res.status, allow: res.headers.get('allow'), body: await res.text() }); + } + return out; + }; + const expected = await frozen('ws-http-same-path', run); + expectFrozenEqual(await run(), expected, 'http at ws paths'); + }); +});