adds accepted lang to global hreq
authorJosé Bollo <jose.bollo@iot.bzh>
Thu, 25 Aug 2016 21:19:16 +0000 (23:19 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Thu, 25 Aug 2016 21:54:20 +0000 (23:54 +0200)
Change-Id: I6b820e7ab169897259414276eaa0b1f8847d9229
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afb-hreq.h
src/afb-hsrv.c

index 81dd3ea..3d7954a 100644 (file)
@@ -41,6 +41,7 @@ struct afb_hreq {
        int suspended;
        int replied;
        const char *version;
+       const char *lang;
        const char *url;
        size_t lenurl;
        const char *tail;
index 12a7fdd..9d83838 100644 (file)
@@ -142,6 +142,7 @@ static int access_handler(
                hreq->connection = connection;
                hreq->method = method;
                hreq->version = version;
+               hreq->lang = afb_hreq_get_header(hreq, MHD_HTTP_HEADER_ACCEPT_LANGUAGE);
                hreq->tail = hreq->url = url;
                hreq->lentail = hreq->lenurl = strlen(url);
                *recordreq = hreq;