Skip to content

Commit 1439f35

Browse files
committed
fix: mark app._handle as private to avoid sub-app detection
1 parent 0e4770a commit 1439f35

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ import { send, createError, sendError, MIMES, stripTrailingSlash } from './utils
77
export function createApp (options: AppOptions = {}): App {
88
const stack: Stack = []
99

10-
const handle = createHandle(stack)
10+
const _handle = createHandle(stack)
1111

1212
// @ts-ignore
1313
const app: Partial<App> = function (req: IncomingMessage, res: ServerResponse) {
14-
return handle(req, res)
14+
return _handle(req, res)
1515
.catch((err: Error | any) => { sendError(res, err, options.debug) })
1616
}
1717

1818
app.stack = stack
19-
app.handle = handle
19+
app._handle = _handle
2020

2121
// @ts-ignore
2222
app.use = (arg1, arg2, arg3) => use(app, arg1, arg2, arg3)

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface AppUse {
3939
export interface App {
4040
(req: IncomingMessage, res: ServerResponse): Promise<any>
4141
stack: Stack
42-
handle: PHandle
42+
_handle: PHandle
4343
use: AppUse
4444
useAsync: AppUse
4545
}

0 commit comments

Comments
 (0)