projects
/
blerg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clarify types in auth
[blerg.git]
/
cgi
/
canned_responses.c
diff --git
a/cgi/canned_responses.c
b/cgi/canned_responses.c
index
2f430b1
..
3b09913
100644
(file)
--- a/
cgi/canned_responses.c
+++ b/
cgi/canned_responses.c
@@
-1,3
+1,6
@@
+/* Blerg is (C) 2011 The Dominion of Awesome, and is distributed under a
+ * BSD-style license. Please see the COPYING file for details.
+ */
#include <stdio.h>
#include <string.h>
#include "canned_responses.h"
#include <stdio.h>
#include <string.h>
#include "canned_responses.h"
@@
-8,6
+11,14
@@
void respond_simple_data(unsigned const char *data, int len) {
fwrite(data, len, 1, stdout);
}
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");
void respond_404() {
printf("Status: 404 Not Found\r\n");
printf("Content-type: text/html\r\n");
@@
-25,9
+36,11
@@
void respond_405() {
}
void respond_JSON_Failure() {
}
void respond_JSON_Failure() {
+ printf("Content-type: application/json\r\n");
respond_simple_data(JSON_FAILURE, strlen(JSON_FAILURE));
}
void respond_JSON_Success() {
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));
}
respond_simple_data(JSON_SUCCESS, strlen(JSON_SUCCESS));
}