We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea6e2ab commit 63dfe46Copy full SHA for 63dfe46
2 files changed
adonis-typings/request.ts
@@ -547,6 +547,7 @@ declare module '@ioc:Adonis/Core/Request' {
547
allowMethodSpoofing: boolean,
548
getIp?: ((request: RequestContract) => string),
549
trustProxy: (address: string, distance: number) => boolean,
550
+ enableAsyncHttpContext?: boolean,
551
}
552
553
/**
src/Server/index.ts
@@ -122,8 +122,10 @@ export class Server implements ServerContract {
122
123
124
private getAsyncContext (ctx: HttpContextContract): InternalAsyncHttpContext | null {
125
- // TODO: check if async context is activated, return null if not.
126
- return new InternalAsyncHttpContext(ctx)
+ if (this.httpConfig.enableAsyncHttpContext) {
+ return new InternalAsyncHttpContext(ctx)
127
+ }
128
+ return null
129
130
131
0 commit comments