X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Ffastcgi.c;h=49bf19716246643484797d8757af349c5d496354;hb=4659fe499233a2dda8e772138fe5f889cab617ed;hp=00d826432d7a25639e39e5153ffa1679d1d9dd88;hpb=2e3ab88d1282fc893c9bd615911aaedc9e552178;p=matches%2FMCTX3420.git diff --git a/server/fastcgi.c b/server/fastcgi.c index 00d8264..49bf197 100644 --- a/server/fastcgi.c +++ b/server/fastcgi.c @@ -213,6 +213,16 @@ void FCGI_JSONDouble(const char *key, double value) printf(",\r\n\t\"%s\" : %f", key, value); } +/** + * Similar to FCGI_JsonPair except for boolean values. + * @param key The key of the JSON entry + * @param value The value associated with the key + */ +void FCGI_JSONBool(const char *key, bool value) +{ + printf(",\r\n\t\"%s\" : %s", key, value ? "true" : "false"); +} + /** * Begins a JSON entry by writing the key. To be used in conjunction * with FCGI_JsonValue. @@ -258,7 +268,7 @@ void FCGI_RejectJSON(FCGIContext *context) FCGI_BeginJSON(context, STATUS_ERROR); FCGI_JSONPair("description", "Invalid request"); FCGI_JSONLong("responsenumber", context->response_number); - FCGI_JSONPair("params", getenv("DOCUMENT_URI_LOCAL")); + FCGI_JSONPair("params", getenv("QUERY_STRING")); FCGI_JSONPair("host", getenv("SERVER_HOSTNAME")); FCGI_JSONPair("user", getenv("REMOTE_USER")); FCGI_JSONPair("ip", getenv("REMOTE_ADDR"));