From a4051040523c3ef2b5591a3226904fed2d974e95 Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Sat, 7 May 2022 22:25:49 +0000 Subject: [PATCH] fix: using latest sasjs headers, closes #231 --- all.sas | 24 +++++++++++++----------- server/ms_createfile.sas | 4 ++-- server/ms_createuser.sas | 8 +++++--- server/ms_deletefile.sas | 2 +- server/ms_getfile.sas | 2 +- server/ms_getusers.sas | 4 ++-- server/ms_runstp.sas | 4 ++-- 7 files changed, 26 insertions(+), 22 deletions(-) diff --git a/all.sas b/all.sas index b02ecc0..c480169 100644 --- a/all.sas +++ b/all.sas @@ -19319,8 +19319,8 @@ data _null_; file &fname1 lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put "Content-Type: multipart/form-data; boundary=&boundary"; - put "Authorization: Bearer " _infile_; + if _n_=1 then put "Content-Type: multipart/form-data; boundary=&boundary"; + put _infile_; run; %if &mdebug=1 %then %do; @@ -19450,9 +19450,11 @@ data _null_; file &fref1 lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put "Authorization: Bearer " _infile_; - put "Content-Type: application/json"; - put "accept: application/json"; + if _n_=1 then do; + put "Content-Type: application/json"; + put "accept: application/json"; + end; + put _infile_; run; %if &mdebug=1 %then %do; @@ -20077,7 +20079,7 @@ data _null_; file &headref lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put "Authorization: Bearer " _infile_; + put _infile_; run; proc http method='DELETE' headerin=&headref @@ -20126,7 +20128,7 @@ data _null_; file &headref lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put "Authorization: Bearer " _infile_; + put _infile_; run; proc http method='GET' out=&binaryfref headerin=&headref @@ -20197,8 +20199,8 @@ data _null_; file &fref0 lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put "Authorization: Bearer " _infile_; - put "accept: application/json"; + if _n_=1 then put "accept: application/json"; + put _infile_; run; %if &mdebug=1 %then %do; @@ -20385,8 +20387,8 @@ data _null_; file &authref lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put 'Authorization: Bearer ' _infile_; - put "Content-Type: multipart/form-data; boundary=&boundary"; + if _n_=1 then put "Content-Type: multipart/form-data; boundary=&boundary"; + put _infile_; run; %if &mdebug=1 %then %do; diff --git a/server/ms_createfile.sas b/server/ms_createfile.sas index b7f2a0c..e8e70f1 100644 --- a/server/ms_createfile.sas +++ b/server/ms_createfile.sas @@ -68,8 +68,8 @@ data _null_; file &fname1 lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put "Content-Type: multipart/form-data; boundary=&boundary"; - put "Authorization: Bearer " _infile_; + if _n_=1 then put "Content-Type: multipart/form-data; boundary=&boundary"; + put _infile_; run; %if &mdebug=1 %then %do; diff --git a/server/ms_createuser.sas b/server/ms_createuser.sas index 619d62b..4da7aab 100644 --- a/server/ms_createuser.sas +++ b/server/ms_createuser.sas @@ -87,9 +87,11 @@ data _null_; file &fref1 lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put "Authorization: Bearer " _infile_; - put "Content-Type: application/json"; - put "accept: application/json"; + if _n_=1 then do; + put "Content-Type: application/json"; + put "accept: application/json"; + end; + put _infile_; run; %if &mdebug=1 %then %do; diff --git a/server/ms_deletefile.sas b/server/ms_deletefile.sas index 20455c0..821f946 100644 --- a/server/ms_deletefile.sas +++ b/server/ms_deletefile.sas @@ -33,7 +33,7 @@ data _null_; file &headref lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put "Authorization: Bearer " _infile_; + put _infile_; run; proc http method='DELETE' headerin=&headref diff --git a/server/ms_getfile.sas b/server/ms_getfile.sas index 09784be..5b75281 100644 --- a/server/ms_getfile.sas +++ b/server/ms_getfile.sas @@ -34,7 +34,7 @@ data _null_; file &headref lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put "Authorization: Bearer " _infile_; + put _infile_; run; proc http method='GET' out=&binaryfref headerin=&headref diff --git a/server/ms_getusers.sas b/server/ms_getusers.sas index c3c6ace..5228736 100644 --- a/server/ms_getusers.sas +++ b/server/ms_getusers.sas @@ -56,8 +56,8 @@ data _null_; file &fref0 lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put "Authorization: Bearer " _infile_; - put "accept: application/json"; + if _n_=1 then put "accept: application/json"; + put _infile_; run; %if &mdebug=1 %then %do; diff --git a/server/ms_runstp.sas b/server/ms_runstp.sas index 32e4d46..95c517a 100644 --- a/server/ms_runstp.sas +++ b/server/ms_runstp.sas @@ -137,8 +137,8 @@ data _null_; file &authref lrecl=1000; infile "&_sasjs_tokenfile" lrecl=1000; input; - put 'Authorization: Bearer ' _infile_; - put "Content-Type: multipart/form-data; boundary=&boundary"; + if _n_=1 then put "Content-Type: multipart/form-data; boundary=&boundary"; + put _infile_; run; %if &mdebug=1 %then %do;