From ee0a9b73669d6eee2e03c336008df31885ff90ed Mon Sep 17 00:00:00 2001 From: Wade Mealing Date: Tue, 6 Aug 2024 01:22:26 +1000 Subject: [PATCH] Ensure that readme provides working demo. Gday, I think that the handler function needs to return a value, and that the socket should be closed. I have provided what I believe is the correct fix. Without this the function crashes after serving only single request. Please consider this PR. Thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 05fc6a2..ff4c665 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ local server = pegasus:new({ port='9090' }) server:start(function (req, rep) rep:addHeader('Date', 'Mon, 15 Jun 2015 14:24:53 GMT'):write('hello pegasus world!') + return rep:close() end) ```