Changeset 828
- Timestamp:
- May 23, 2017, 1:54:31 PM (8 years ago)
- Location:
- trunk/zoo-project
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/HISTORY.txt
r817 r828 1 1 Version 1.7.0-dev 2 * Support headers for GET requests from the js ZOO-API 2 3 * Pass all headers listed in the attributes parameter from the 3 4 [security] section to the hosts listed in the hosts parameter of the -
trunk/zoo-project/zoo-api/js/ZOO-api.js
r625 r828 436 436 * url - {String} The URL to request. 437 437 * params - {Object} Params to add to the url 438 * headers - {Object/Array} A key-value object of headers 438 439 * 439 440 * Returns: 440 441 * {String} Request result. 441 442 */ 442 Get: function(url,params) {443 Get: function(url,params,headers) { 443 444 var paramsArray = []; 444 445 for (var key in params) { … … 466 467 url += separator + paramString; 467 468 } 468 return ZOORequest('GET',url); 469 if(!(headers instanceof Array)) { 470 var headersArray = []; 471 for (var name in headers) { 472 headersArray.push(name+': '+headers[name]); 473 } 474 headers = headersArray; 475 } 476 return ZOORequest('GET',url,headers); 469 477 }, 470 478 /** -
trunk/zoo-project/zoo-kernel/service_internal_js.c
r790 r828 934 934 }else{ 935 935 if(argc==3){ 936 char *body=JSValToChar(cx,&argv[2]); 937 InternetOpenUrl(&hInternet,hInternet.waitingRequests[hInternet.nb],body,strlen(body), 938 INTERNET_FLAG_NO_CACHE_WRITE,0); 939 processDownloads(&hInternet); 940 free(body); 936 if(strncasecmp(method,"GET",3)==0){ 937 header=JSVAL_TO_OBJECT(argv[2]); 938 if(JS_IsArrayObject(cx,header)){ 939 setHeader(&hInternet,cx,header); 940 } 941 InternetOpenUrl(&hInternet,hInternet.waitingRequests[hInternet.nb],NULL,0, 942 INTERNET_FLAG_NO_CACHE_WRITE,0); 943 processDownloads(&hInternet); 944 }else{ 945 char *body=JSValToChar(cx,&argv[2]); 946 InternetOpenUrl(&hInternet,hInternet.waitingRequests[hInternet.nb],body,strlen(body), 947 INTERNET_FLAG_NO_CACHE_WRITE,0); 948 processDownloads(&hInternet); 949 free(body); 950 } 941 951 }else{ 942 952 InternetOpenUrl(&hInternet,hInternet.waitingRequests[hInternet.nb],NULL,0, -
trunk/zoo-project/zoo-kernel/ulinet.c
r827 r828 185 185 * @param proto the protocol requiring the use of a proxy 186 186 */ 187 boolsetProxiesForProtcol(CURL* handle,const char *proto){187 int setProxiesForProtcol(CURL* handle,const char *proto){ 188 188 #ifdef MSG_LAF_VERBOSE 189 189 fprintf( stderr, "setProxiesForProtocol (do nothing) ...\n" );
Note: See TracChangeset
for help on using the changeset viewer.