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 d0bb082 commit ac1c066Copy full SHA for ac1c066
packages/core/helpers/context-id-factory.ts
@@ -27,16 +27,19 @@ export class ContextIdFactory {
27
*/
28
public static getByRequest<T extends Record<any, any> = any>(
29
request: T,
30
+ propsToInspect: string[] = ['raw'],
31
): ContextId {
32
if (!request) {
- return createContextId();
33
+ return ContextIdFactory.create();
34
}
35
if (request[REQUEST_CONTEXT_ID as any]) {
36
return request[REQUEST_CONTEXT_ID as any];
37
- if (request.raw && request.raw[REQUEST_CONTEXT_ID]) {
38
- return request.raw[REQUEST_CONTEXT_ID];
+ for (const key of propsToInspect) {
39
+ if (request[key]?.[REQUEST_CONTEXT_ID]) {
40
+ return request[key][REQUEST_CONTEXT_ID];
41
+ }
42
43
44
45
0 commit comments