X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hreq.c;h=613d4199d7d60fe9074f2a8fb0b56e91fd2fb545;hb=e18643b7ac16dd5663753fb6ddbc49c7deb06e78;hp=19efd4b2b3cea7054dc3a6e21bddeedeff7f2754;hpb=1ddea9dd3848c640c0c63ba87056f6a850a7323d;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hreq.c b/src/afb-hreq.c index 19efd4b2..613d4199 100644 --- a/src/afb-hreq.c +++ b/src/afb-hreq.c @@ -23,11 +23,12 @@ #include "../include/local-def.h" #include "afb-method.h" +#include "afb-req-itf.h" #include "afb-hreq.h" - static char empty_string[1] = ""; + /* a valid subpath is a relative path not looking deeper than root using .. */ static int validsubpath(const char *subpath) { @@ -229,3 +230,18 @@ int afb_hreq_redirect_to(struct afb_hreq *hreq, const char *url) return 1; } +const char *afb_hreq_get_cookie(struct afb_hreq *hreq, const char *name) +{ + return MHD_lookup_connection_value(hreq->connection, MHD_COOKIE_KIND, name); +} + +const char *afb_hreq_get_argument(struct afb_hreq *hreq, const char *name) +{ + return MHD_lookup_connection_value(hreq->connection, MHD_GET_ARGUMENT_KIND, name); +} + +struct afb_req_itf afb_hreq_itf = { + .get_cookie = (void*)afb_hreq_get_cookie, + .get_argument = (void*)afb_hreq_get_argument +}; +