summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libwaitress/waitress.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libwaitress/waitress.c b/src/libwaitress/waitress.c
index 2101e2a..5e3fd41 100644
--- a/src/libwaitress/waitress.c
+++ b/src/libwaitress/waitress.c
@@ -539,8 +539,12 @@ static WaitressHandlerReturn_t WaitressHandleChunked (WaitressHandle_t *waith,
waith->request.chunkSize) == WAITRESS_HANDLER_ABORTED) {
return WAITRESS_HANDLER_ABORTED;
}
- /* FIXME: skip trailing \r\n */
- content += waith->request.chunkSize+2;
+ content += waith->request.chunkSize;
+ if (content[0] == '\r' && content[1] == '\n') {
+ content += 2;
+ } else {
+ return WAITRESS_HANDLER_ERR;
+ }
waith->request.chunkSize = 0;
} else {
if (WaitressHandleIdentity (waith, content, remaining) ==