]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/nb.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 26 May 2018 00:27:56 +0000 (01:27 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 26 May 2018 00:27:56 +0000 (01:27 +0100)
etc/profile.d/nb.sh
www/dbq/dbq.php

index ccc1b49a64072236b1f588e163ee8cb2ef37c5cc..18c782e99b394e8220d0ce15bf26a72462215627 100644 (file)
@@ -83,10 +83,11 @@ nb_php() {
 
 nb_api() {
        local uri="$1"; shift
+       #echo "https://api.nbdom.net$uri $@"; return 0;
        if [ -z "$NB_AUTH" -o x = x$(awk '/^machine api.nbdom.net / { print $4":"$6}' $HOME/.netrc 2> /dev/null) ]; then
-               curl -su "$NB_AUTH" "https://api.nbdom.net$uri" "$@"
+               curl -sfS -u "$NB_AUTH" "https://api.nbdom.net$uri" "$@"
        else
-               curl -s --netrc-optional "https://api.nbdom.net$uri" "$@"
+               curl -sfS --netrc-optional "https://api.nbdom.net$uri" "$@"
        fi
 }
 
@@ -107,6 +108,7 @@ nb_api_post() {
        fi
        (
                eval "$(eval "$curl")" #&& echo "$table: $rowCount: $args"
+               #eval "$curl" #&& echo "$table: $rowCount: $args"
        )
 }
 
index e93d2b6e3427997732a6b30cb21d4d6ee1840dea..48b56cb808c7c5a493fa44c53b87583600da695e 100644 (file)
@@ -778,6 +778,8 @@ class DbQ extends nb {
        public function not_found($admin_msg='') {
                header('Content-type: text/plain');
                $msg = '404 Not Found';
+               #$msg = '510 Not Implemented';
+               $msg = '400 Bad Request';
 
                if (empty($_SERVER['SERVER_PROTOCOL'])) $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0';