From: Fulup Ar Foll Date: Fri, 13 May 2016 17:10:32 +0000 (+0200) Subject: Fixed Sample POST/JSON X-Git-Tag: blowfish_2.0.1~118 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=commitdiff_plain;h=6f058dbce7f7f96c458820534f774b9b2b358607 Fixed Sample POST/JSON --- 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 d2356484..5b0153c2 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