From: Fulup Ar Foll Date: Fri, 13 May 2016 17:10:54 +0000 (+0200) Subject: Merge branch 'master' of https://github.com/iotbzh/afb-daemon X-Git-Tag: blowfish_2.0.1~117 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=c7e9786d408f13d8f8f43c6b68da916bbb1ed5f3;hp=8112056eecede587bf884f56629858c8b21bdbec;p=src%2Fapp-framework-binder.git Merge branch 'master' of https://github.com/iotbzh/afb-daemon --- diff --git a/README.md b/README.md index 0e966d16..17ddec25 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,13 @@ $ cmake ..
$ make; make install
``` +### Testing/Debug +``` +$ AFB_DAEMON_DIR=$HOME/afb-daemon +$ $AFB_DAEMON_DIR/build/afb-daemon --help +$ $AFB_DAEMON_DIR/build/afb-daemon --port=1234 --token='' --ldpaths=$AFB_DAEMON_DIR/build --sessiondir=/tmp --rootdir=$AFB_DAEMON_DIR/test +``` + ### Starting ``` $ afb-daemon --help diff --git a/src/afb-hsrv.c b/src/afb-hsrv.c index 06c90df0..743315cb 100644 --- a/src/afb-hsrv.c +++ b/src/afb-hsrv.c @@ -156,7 +156,9 @@ static int access_handler( if (hreq->postform == NULL) afb_hreq_reply_error(hreq, MHD_HTTP_INTERNAL_SERVER_ERROR); return MHD_YES; - } else if (strcasestr(type, JSON_CONTENT) == NULL) { + } else if (strcasestr(type, JSON_CONTENT) != NULL) { + return MHD_YES; + } else { afb_hreq_reply_error(hreq, MHD_HTTP_UNSUPPORTED_MEDIA_TYPE); return MHD_YES; } diff --git a/test/sample-post.html b/test/sample-post.html index 337df97b..b1486c3b 100644 --- a/test/sample-post.html +++ b/test/sample-post.html @@ -3,13 +3,59 @@ Sample Post test

Sample Post test

+ +

Sample Post File

- - -
    -
  1. -
  2. -
  3. -
  4. -
  5. + + +
    +
  6. + +

    Sample Post JSON

    + +
    + + + + + +
    +

    + + + + + + + \ No newline at end of file