ubus: add ACL support for "subscribe" request
[project/uhttpd.git] / proc.c
diff --git a/proc.c b/proc.c
index e360897467ef94f56035c463fffe5fa232560e02..2b69703a07106066fccfa71a3f01363454398e93 100644 (file)
--- a/proc.c
+++ b/proc.c
@@ -30,6 +30,7 @@
        __header(connection, connection) \
        __header(cookie, cookie) \
        __header(host, host) \
+       __header(origin, origin) \
        __header(referer, referer) \
        __header(user_agent, user-agent) \
        __header(content_type, content-type) \
@@ -63,6 +64,7 @@ static const struct {
        { "HTTP_CONNECTION", HDR_connection },
        { "HTTP_COOKIE", HDR_cookie },
        { "HTTP_HOST", HDR_host },
+       { "HTTP_ORIGIN", HDR_origin },
        { "HTTP_REFERER", HDR_referer },
        { "HTTP_USER_AGENT", HDR_user_agent },
        { "HTTP_X_HTTP_METHOD_OVERRIDE", HDR_x_http_method_override },
@@ -223,14 +225,13 @@ static void proc_handle_header(struct relay *r, const char *name, const char *va
 static void proc_handle_header_end(struct relay *r)
 {
        struct client *cl = r->cl;
-       struct dispatch_proc *p = &cl->dispatch.proc;
        struct blob_attr *cur;
        int rem;
 
-       uloop_timeout_cancel(&p->timeout);
        uh_http_header(cl, cl->dispatch.proc.status_code, cl->dispatch.proc.status_msg);
        blob_for_each_attr(cur, cl->dispatch.proc.hdr.head, rem)
-               ustream_printf(cl->us, "%s: %s\r\n", blobmsg_name(cur), blobmsg_data(cur));
+               ustream_printf(cl->us, "%s: %s\r\n", blobmsg_name(cur),
+                              blobmsg_get_string(cur));
 
        ustream_printf(cl->us, "\r\n");