]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
ui-shared: add support for NO_HTTP=1/--nohttp
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index a92383d520d79ec1e590504766436f448884fa98..36777b5de4ba10c7823152384e12c611020fcd8c 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -253,6 +253,7 @@ static void prepare_context(struct cgit_context *ctx)
        ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG"));
        ctx->env.http_host = xstrdupn(getenv("HTTP_HOST"));
        ctx->env.https = xstrdupn(getenv("HTTPS"));
        ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG"));
        ctx->env.http_host = xstrdupn(getenv("HTTP_HOST"));
        ctx->env.https = xstrdupn(getenv("HTTPS"));
+       ctx->env.no_http = xstrdupn(getenv("NO_HTTP"));
        ctx->env.path_info = xstrdupn(getenv("PATH_INFO"));
        ctx->env.query_string = xstrdupn(getenv("QUERY_STRING"));
        ctx->env.request_method = xstrdupn(getenv("REQUEST_METHOD"));
        ctx->env.path_info = xstrdupn(getenv("PATH_INFO"));
        ctx->env.query_string = xstrdupn(getenv("QUERY_STRING"));
        ctx->env.request_method = xstrdupn(getenv("REQUEST_METHOD"));
@@ -445,6 +446,9 @@ static void cgit_parse_args(int argc, const char **argv)
                if (!strcmp(argv[i], "--nocache")) {
                        ctx.cfg.nocache = 1;
                }
                if (!strcmp(argv[i], "--nocache")) {
                        ctx.cfg.nocache = 1;
                }
+               if (!strcmp(argv[i], "--nohttp")) {
+                       ctx.env.no_http = "1";
+               }
                if (!strncmp(argv[i], "--query=", 8)) {
                        ctx.qry.raw = xstrdup(argv[i]+8);
                }
                if (!strncmp(argv[i], "--query=", 8)) {
                        ctx.qry.raw = xstrdup(argv[i]+8);
                }