From 1e997855a29924a33bd3778dfc5ce2e654863ca4 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Tue, 10 Nov 2020 21:06:06 -0500 Subject: [PATCH] support expect 100 continue --- cgi.d | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cgi.d b/cgi.d index ce4fc3d..98bb8c7 100644 --- a/cgi.d +++ b/cgi.d @@ -440,9 +440,6 @@ enum long defaultMaxContentLength = 5_000_000; // somehow in here and dom.d. -// FIXME: 100 Continue in the nph section? Probably belongs on the -// httpd class though. - // these are public so you can mixin GenericMain. // FIXME: use a function level import instead! public import std.string; @@ -1836,6 +1833,16 @@ class Cgi { } else if (name == "cookie") { cookie ~= value; + } else if(name == "expect") { + if(value == "100-continue") { + // FIXME we should probably give user code a chance + // to process and reject but that needs to be virtual, + // perhaps part of the CGI redesign. + + // FIXME: if size is > max content length it should + // also fail at this point. + _rawDataOutput(cast(ubyte[]) "HTTP/1.1 100 Continue\r\n\r\n"); + } } // else // ignore it