Passing though unsupported HTTP methods instead of returning a 501 Not Implemented?

"Peter L. Mogan" <[email protected]> Mon, 20 Nov 2006 13:50:46 -0800 (PST)
Newsgroups gmane.network.mathopd
Message-ID <[email protected]>
Hello,

We are testing out mathopd to see if we can use it to
run a FastCGI application (using spawn-fcgi, cgi-fcgi,
and PHP 5.1.6).

We originally planned to use lighttpd, but lighttpd
has a bug on the 100-Continue Status handling, which
hinders our application's ability to interact with
some clients.  

Looking further into the requst.c, I saw the
following:

static const char m_get[] =                     "GET";
static const char m_head[] =                   
"HEAD";
static const char m_post[] =                   
"POST";

As far as I could tell, there isn't an existing way to
pass through any unsupported HTTP methods, e.g. DELETE
to either a CGI or a FastCGI process.  In the function
static int process_headers(struct request *r), the
following block is very clear in this regard:

        if (strcmp(s, m_get) == 0)
                r->method = M_GET;
        else {
                if (strcmp(s, m_head) == 0)
                        r->method = M_HEAD;
                else if (strcmp(s, m_post) == 0)
                        r->method = M_POST;
                else {
                        if (debug)
                                log_d("method \"%s\"
not implemented", s);
                        r->status = 501;
                        return 0;
                }
        }


I must say the request.c is really a piece of cleanly
written code. We are tempted to patch it so we can
toggle it to pass through HTTP methods that don't have
built-in support. But before we embark such an
endeavor, we would like to hear people's comments
first, especially, are we re-inventing the wheel?  

I did review the mailing list archive and didn't see
any activities in this regard.

Thanks,

--Peter