Skip to content

Commit 5dbd9cd

Browse files
authored
fix: operation on s3 protocol (#592)
1 parent 29a13ff commit 5dbd9cd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/http/plugins/db.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const db = fastifyPlugin(
4949
headers: request.headers,
5050
path: request.url,
5151
method: request.method,
52-
operation: request.operation?.type,
52+
operation: () => request.operation?.type,
5353
})
5454
})
5555

@@ -111,6 +111,7 @@ export const dbSuperUser = fastifyPlugin<DbSuperUserPluginOptions>(
111111
method: request.method,
112112
headers: request.headers,
113113
disableHostCheck: opts.disableHostCheck,
114+
operation: () => request.operation?.type,
114115
})
115116
})
116117

src/internal/database/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface ConnectionOptions {
1212
user: User
1313
superUser: User
1414
disableHostCheck?: boolean
15-
operation?: string
15+
operation?: () => string | undefined
1616
}
1717

1818
/**

src/internal/database/connection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface TenantConnectionOptions {
3434
headers?: Record<string, string | undefined | string[]>
3535
method?: string
3636
path?: string
37-
operation?: string
37+
operation?: () => string | undefined
3838
}
3939

4040
export interface User {
@@ -252,7 +252,7 @@ export class TenantConnection {
252252
headers,
253253
this.options.method || '',
254254
this.options.path || '',
255-
this.options.operation || '',
255+
this.options.operation?.() || '',
256256
]
257257
)
258258
}

0 commit comments

Comments
 (0)