X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=cgi%2Fcanned_responses.c;h=3b09913eae64a1442b21174648ac4e0e86143008;hb=8cf18d84c5d5c49cfab0e181e9bb3c2777554da2;hp=fb79b6fd3df1ee1f71a7d90cd03a81c7e28c32e3;hpb=54789cc8538714fc3622646721f6f2ecceae94ac;p=blerg.git diff --git a/cgi/canned_responses.c b/cgi/canned_responses.c index fb79b6f..3b09913 100644 --- a/cgi/canned_responses.c +++ b/cgi/canned_responses.c @@ -11,6 +11,14 @@ void respond_simple_data(unsigned const char *data, int len) { fwrite(data, len, 1, stdout); } +void respond_403() { + printf("Status: 403 Forbidden\r\n"); + printf("Content-type: text/html\r\n"); + printf("Content-length: %d\r\n\r\n", strlen(CONTENT_403)); + + printf(CONTENT_403); +} + void respond_404() { printf("Status: 404 Not Found\r\n"); printf("Content-type: text/html\r\n"); @@ -28,9 +36,11 @@ void respond_405() { } void respond_JSON_Failure() { + printf("Content-type: application/json\r\n"); respond_simple_data(JSON_FAILURE, strlen(JSON_FAILURE)); } void respond_JSON_Success() { + printf("Content-type: application/json\r\n"); respond_simple_data(JSON_SUCCESS, strlen(JSON_SUCCESS)); }