aotrautils 0.0.309 → 0.0.311

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (03/12/2022-16:04:12)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (03/12/2022-16:28:09)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4827,7 +4827,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4827
4827
 
4828
4828
 
4829
4829
 
4830
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (03/12/2022-16:04:12)»*/
4830
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (03/12/2022-16:28:09)»*/
4831
4831
  /*-----------------------------------------------------------------------------*/
4832
4832
  /* ## Utility global methods in a browser (htmljs) client environment.
4833
4833
  *
@@ -12948,7 +12948,7 @@ createOritaMicroClient=function(url, port, isNode=false){
12948
12948
  };
12949
12949
 
12950
12950
 
12951
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (03/12/2022-16:04:12)»*/
12951
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (03/12/2022-16:28:09)»*/
12952
12952
  /*-----------------------------------------------------------------------------*/
12953
12953
 
12954
12954
 
@@ -14176,7 +14176,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14176
14176
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14177
14177
 
14178
14178
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14179
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (03/12/2022-16:04:12)»*/
14179
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (03/12/2022-16:28:09)»*/
14180
14180
  /*-----------------------------------------------------------------------------*/
14181
14181
 
14182
14182
 
@@ -15215,9 +15215,6 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
15215
15215
  }
15216
15216
 
15217
15217
 
15218
- // To remove the CORS error message (cf. https://medium.com/@dtkatz/3-ways-to-fix-the-cors-error-and-how-access-control-allow-origin-works-d97d55946d9)
15219
- if(ADD_CORS_HEADER) response.header('Access-Control-Allow-Origin', '*');
15220
-
15221
15218
 
15222
15219
  const urlFile="." + url;
15223
15220
 
@@ -15226,6 +15223,12 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
15226
15223
 
15227
15224
  let contentType="text/html";
15228
15225
 
15226
+ const headers={ "Content-Type": contentType };
15227
+
15228
+ // To remove the CORS error message (cf. https://medium.com/@dtkatz/3-ways-to-fix-the-cors-error-and-how-access-control-allow-origin-works-d97d55946d9)
15229
+ if(ADD_CORS_HEADER) headers["Access-Control-Allow-Origin"]="*";
15230
+
15231
+
15229
15232
  fs.readFile(filePath, function(error, fileContent){
15230
15233
  if(error){
15231
15234
  if(error.code=="ENOENT"){
@@ -15233,7 +15236,7 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
15233
15236
  console.log("ERROR 404 file not found :"+filePath);
15234
15237
 
15235
15238
  fs.readFile("./404.html", function(error, fileContent){
15236
- response.writeHead(200, { "Content-Type": contentType });
15239
+ response.writeHead(200, headers);
15237
15240
  response.end(fileContent, "utf-8");
15238
15241
  });
15239
15242
 
@@ -15253,7 +15256,8 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
15253
15256
  // TRACE
15254
15257
  console.log("INFO 200 OK :"+filePath);
15255
15258
 
15256
- response.writeHead(200, { "Content-Type": contentType });
15259
+
15260
+ response.writeHead(200, headers);
15257
15261
  response.end(fileContent, "utf-8");
15258
15262
 
15259
15263
  // res.writeHead(200);
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.309",
3
+ "version": "0.0.311",
4
4
  "main": "aotrautils.build.js",
5
5
  "description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",