summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/httpd.c b/httpd.c
index bf72d5a..7728d04 100644
--- a/httpd.c
+++ b/httpd.c
@@ -24,8 +24,7 @@ int server_get_handler(d_char *req, char *q_path,
24/* basic server services */ 24/* basic server services */
25{ 25{
26 int status = 0; 26 int status = 0;
27 char *req_hdrs = xs_dict_get(req, "headers"); 27 char *acpt = xs_dict_get(req, "accept");
28 char *acpt = xs_dict_get(req_hdrs, "accept");
29 28
30 if (acpt == NULL) 29 if (acpt == NULL)
31 return 400; 30 return 400;
@@ -90,7 +89,6 @@ void httpd_connection(int rs)
90{ 89{
91 FILE *f; 90 FILE *f;
92 xs *req; 91 xs *req;
93 char *req_hdrs;
94 char *method; 92 char *method;
95 int status = 0; 93 int status = 0;
96 char *body = NULL; 94 char *body = NULL;
@@ -106,10 +104,8 @@ void httpd_connection(int rs)
106 104
107 req = xs_httpd_request(f, &payload, &p_size); 105 req = xs_httpd_request(f, &payload, &p_size);
108 106
109 req_hdrs = xs_dict_get(req, "headers"); 107 method = xs_dict_get(req, "method");
110 108 q_path = xs_dup(xs_dict_get(req, "path"));
111 method = xs_dict_get(req_hdrs, "method");
112 q_path = xs_dup(xs_dict_get(req_hdrs, "path"));
113 109
114 /* crop the q_path from leading / and the prefix */ 110 /* crop the q_path from leading / and the prefix */
115 if (xs_endswith(q_path, "/")) 111 if (xs_endswith(q_path, "/"))