Skip to content

Commit 3fd1f38

Browse files
committed
fix empty lambda warning
1 parent 6abf6c3 commit 3fd1f38

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/serve.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ function createCallback(response) {
4545
);
4646
} else {
4747
if (
48-
process.env.CONTEXT !== "production" ||
48+
response.statusCode !== 204 &&
49+
process.env.CONTEXT !== "production" &&
4950
!process.env.SILENCE_EMPTY_LAMBDA_WARNING
5051
)
5152
console.log(
5253
`Your lambda function didn't return a body, which may be a mistake. Check our Usage docs for examples (https://github.com/netlify/netlify-lambda#usage).
53-
If this is intentional, you can silence this warning by setting process.ENV.SILENCE_EMPTY_LAMBDA_WARNING to a truthy value or process.env.CONTEXT to 'production'`
54+
If this is intentional, you can silence this warning by setting process.env.SILENCE_EMPTY_LAMBDA_WARNING to a truthy value or process.env.CONTEXT to 'production'`
5455
);
5556
}
5657
response.end();

0 commit comments

Comments
 (0)