Skip to content

Commit 7a91f67

Browse files
authored
Merge branch 'main' into beta
2 parents 13fa225 + 59b67fa commit 7a91f67

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,8 @@ In addition to these types, `@octokit/webhooks` exports 2 types specific to itse
699699

700700
Note that changes to the exported types are not considered breaking changes, as the changes will not impact production code, but only fail locally or during CI at build time.
701701

702+
**⚠️ Caution ⚠️**: Webhooks Types are expected to be used with the [`strictNullChecks` option](https://www.typescriptlang.org/tsconfig#strictNullChecks) enabled in your `tsconfig`. If you don't have this option enabled, there's the possibility that you get `never` as the inferred type in some use cases. See [octokit/webhooks#395](https://github.com/octokit/webhooks/issues/395) for details.
703+
702704
### `EmitterWebhookEventName`
703705

704706
A union of all possible events and event/action combinations supported by the event emitter, e.g. `"check_run" | "check_run.completed" | ... many more ... | "workflow_run.requested"`.

src/middleware/node/get-payload.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export function getPayload(request: IncomingMessage): Promise<string> {
2727
request.on("data", (chunk: string) => (data += chunk));
2828
request.on("end", () => {
2929
try {
30-
JSON.parse(data); // check if data is valid JSON
30+
// Call JSON.parse() only to check if the payload is valid JSON
31+
JSON.parse(data);
3132
resolve(data);
3233
} catch (error: any) {
3334
error.message = "Invalid JSON";

0 commit comments

Comments
 (0)