aotrautils 0.0.310 → 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:08:42)»*/
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:08:42)»*/
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:08:42)»*/
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:08:42)»*/
14179
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (03/12/2022-16:28:09)»*/
14180
14180
  /*-----------------------------------------------------------------------------*/
14181
14181
 
14182
14182
 
@@ -15223,6 +15223,12 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
15223
15223
 
15224
15224
  let contentType="text/html";
15225
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
+
15226
15232
  fs.readFile(filePath, function(error, fileContent){
15227
15233
  if(error){
15228
15234
  if(error.code=="ENOENT"){
@@ -15230,7 +15236,7 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
15230
15236
  console.log("ERROR 404 file not found :"+filePath);
15231
15237
 
15232
15238
  fs.readFile("./404.html", function(error, fileContent){
15233
- response.writeHead(200, { "Content-Type": contentType });
15239
+ response.writeHead(200, headers);
15234
15240
  response.end(fileContent, "utf-8");
15235
15241
  });
15236
15242
 
@@ -15250,11 +15256,6 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
15250
15256
  // TRACE
15251
15257
  console.log("INFO 200 OK :"+filePath);
15252
15258
 
15253
- const headers={ "Content-Type": contentType };
15254
-
15255
- // 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)
15256
- if(ADD_CORS_HEADER) headers["Access-Control-Allow-Origin"]="*";
15257
-
15258
15259
 
15259
15260
  response.writeHead(200, headers);
15260
15261
  response.end(fileContent, "utf-8");
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.310",
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)",