diff src/c/http.c @ 1799:3d922a28370b

Basis.getenv
author Adam Chlipala <adam@chlipala.net>
date Thu, 02 Aug 2012 16:33:25 -0400
parents 7095e1b7240b
children 6a2cc604a322
line wrap: on
line diff
--- a/src/c/http.c	Sun Jul 29 12:54:17 2012 -0400
+++ b/src/c/http.c	Thu Aug 02 16:33:25 2012 -0400
@@ -40,6 +40,10 @@
   return NULL;
 }
 
+static char *get_env(void *data, const char *name) {
+  return getenv(name);
+}
+
 static void on_success(uw_context ctx) {
   uw_write_header(ctx, "HTTP/1.1 200 OK\r\n");
 }
@@ -193,6 +197,7 @@
         }
 
         uw_set_headers(ctx, get_header, headers);
+        uw_set_env(ctx, get_env, NULL);
 
         printf("Serving URI %s....\n", path);
         rr = uw_request(rc, ctx, method, path, query_string, body, back - body,