Skip to content

Commit 1f40f4f

Browse files
Make sure identity is checked before /discovery and /invoke, but after /health (#497)
1 parent a863d64 commit 1f40f4f

File tree

1 file changed

+5
-5
lines changed
  • packages/restate-sdk/src/endpoint/handlers

1 file changed

+5
-5
lines changed

packages/restate-sdk/src/endpoint/handlers/generic.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,6 @@ export class GenericHandler implements RestateHandler {
131131
const path = new URL(request.url, "https://example.com").pathname;
132132
const parsed = parseUrlComponents(path);
133133

134-
const error = this.validateConnectionSignature(path, request.headers);
135-
if (error !== null) {
136-
return error;
137-
}
138-
139134
if (parsed.type === "unknown") {
140135
const msg = `Invalid path. Allowed are /health, or /discover, or /invoke/SvcName/handlerName, but was: ${path}`;
141136
this.endpoint.rlog.trace(msg);
@@ -152,6 +147,11 @@ export class GenericHandler implements RestateHandler {
152147
statusCode: 200,
153148
};
154149
}
150+
151+
const error = this.validateConnectionSignature(path, request.headers);
152+
if (error !== null) {
153+
return error;
154+
}
155155
if (parsed.type === "discover") {
156156
return this.handleDiscovery(request.headers["accept"]);
157157
}

0 commit comments

Comments
 (0)