summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-08-25 23:19:16 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-08-25 23:54:20 +0200
commit15c3a8b1ef47127d30d8b5f26f9d7622a0b72656 (patch)
tree13057f6e664bcec7d076f1f5ec2202050c89cfbf
parentc44a48f295de04e4d0385b05d1afd93fac898d10 (diff)
adds accepted lang to global hreq
Change-Id: I6b820e7ab169897259414276eaa0b1f8847d9229 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-hreq.h1
-rw-r--r--src/afb-hsrv.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/afb-hreq.h b/src/afb-hreq.h
index 81dd3eaf..3d7954a9 100644
--- a/src/afb-hreq.h
+++ b/src/afb-hreq.h
@@ -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;
diff --git a/src/afb-hsrv.c b/src/afb-hsrv.c
index 12a7fdd3..9d838381 100644
--- a/src/afb-hsrv.c
+++ b/src/afb-hsrv.c
@@ -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;