Skip to content

Commit d846cf5

Browse files
author
Andrew Matheny
committed
Expose http path in call
1 parent b78db9d commit d846cf5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/grpc-js/src/server-call.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export type ServerSurfaceCall = {
8080
getPeer(): string;
8181
sendMetadata(responseMetadata: Metadata): void;
8282
getDeadline(): Deadline;
83+
getPath(): string;
8384
} & EventEmitter;
8485

8586
export type ServerUnaryCall<RequestType, ResponseType> = ServerSurfaceCall & {
@@ -127,6 +128,10 @@ export class ServerUnaryCallImpl<RequestType, ResponseType>
127128
getDeadline(): Deadline {
128129
return this.call.getDeadline();
129130
}
131+
132+
getPath(): string {
133+
return this.call.getPath();
134+
}
130135
}
131136

132137
export class ServerReadableStreamImpl<RequestType, ResponseType>
@@ -165,6 +170,10 @@ export class ServerReadableStreamImpl<RequestType, ResponseType>
165170
getDeadline(): Deadline {
166171
return this.call.getDeadline();
167172
}
173+
174+
getPath(): string {
175+
return this.call.getPath();
176+
}
168177
}
169178

170179
export class ServerWritableStreamImpl<RequestType, ResponseType>
@@ -202,6 +211,10 @@ export class ServerWritableStreamImpl<RequestType, ResponseType>
202211
return this.call.getDeadline();
203212
}
204213

214+
getPath(): string {
215+
return this.call.getPath();
216+
}
217+
205218
_write(
206219
chunk: ResponseType,
207220
encoding: string,
@@ -279,6 +292,10 @@ export class ServerDuplexStreamImpl<RequestType, ResponseType>
279292
return this.call.getDeadline();
280293
}
281294

295+
getPath(): string {
296+
return this.call.getPath();
297+
}
298+
282299
// eslint-disable-next-line @typescript-eslint/no-explicit-any
283300
end(metadata?: any) {
284301
if (metadata) {
@@ -901,6 +918,10 @@ export class Http2ServerCallStream<
901918
getDeadline(): Deadline {
902919
return this.deadline;
903920
}
921+
922+
getPath(): string {
923+
return this.handler.path;
924+
}
904925
}
905926

906927
/* eslint-disable @typescript-eslint/no-explicit-any */

0 commit comments

Comments
 (0)