(input: string | Request | URL)
| 14 | const INTERNAL_REQUEST_ORIGIN = 'auto.http.hono.internal_request'; |
| 15 | |
| 16 | function extractPathname(input: string | Request | URL): string { |
| 17 | if (typeof input === 'string') { |
| 18 | return /^https?:\/\//.test(input) ? new URL(input).pathname : input; |
| 19 | } |
| 20 | |
| 21 | return input instanceof Request ? new URL(input.url).pathname : input.pathname; |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Patches `app.request()` on a Hono instance so that each internal dispatch |