Skip to content

Commit

Permalink
feat: add validation on endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhoue-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Jun 30, 2023
1 parent ca3a5da commit 3a3457b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions server/services/CommonService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ export default class IndexService {
try {
const { callAsCurrentUser: callWithRequest } = this.osDriver.asScoped(request);
const finalData = data;

/**
* The endpoint must not be an empty string, reference from proxy caller
*/
if (!endpoint) {
return response.custom({
statusCode: 200,
body: {
ok: false,
error: `Expected non-empty string on endpoint`,
},
});
}

/**
* Update path parameter to follow RFC/generic HTTP convention
*/
Expand Down

0 comments on commit 3a3457b

Please sign in to comment.