URI: 
       First stub for new http-compatibility feature. - geomyidae - A small C-based gopherd.
  HTML git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
   DIR Log
   DIR Files
   DIR Refs
   DIR Tags
   DIR README
   DIR LICENSE
       ---
   DIR commit 3a876cbe4fb9b93ecf98decfa79e7f9b27dbc320
   DIR parent 646c0c9ac1c8944393c3640c63ffefd6f400c2a5
  HTML Author: Christoph Lohmann <20h@r-36.net>
       Date:   Sat, 22 Jul 2023 17:14:59 +0200
       
       First stub for new http-compatibility feature.
       
       Diffstat:
         M main.c                              |      19 +++++++++++++++++++
       
       1 file changed, 19 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/main.c b/main.c
       @@ -187,6 +187,25 @@ handlerequest(int sock, char *req, int rlen, char *base, char *ohost,
                if (c)
                        c[0] = '\0';
        
       +        /*
       +         * Try to guess if we have some HTTP-like protocol compatibility
       +         * mode.
       +         */
       +        if (!nocgi && recvb[0] != '/' && (c = strchr(recvb, " "))) {
       +                *c = '\0';
       +                if (strchr(recvb, '/'))
       +                        goto dothegopher;
       +                if (snprintf(path, "%s/%s", base, recvb) <= sizeof(path)) {
       +                        if (realpath(path, (char *)rpath)) {
       +                                if (stat(rpath, &dir)) {
       +                                        handlecgi(sock, rpath, port, base, NULL, NULL, ohost,
       +                                                clienth, serverh, istls, req, NULL);
       +                                }
       +                        }
       +                }
       +        }
       +dothegopher:
       +
                /* Do not allow requests including "..". */
                if (strstr(recvb, "..")) {
                        dprintf(sock, "%s", selinval);