aotrautils-srv 0.0.305 → 0.0.306

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:15)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (03/12/2022-16:08:46)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4827,7 +4827,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4827
4827
 
4828
4828
 
4829
4829
 
4830
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (03/12/2022-16:04:15)»*/
4830
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (03/12/2022-16:08:46)»*/
4831
4831
  /*-----------------------------------------------------------------------------*/
4832
4832
 
4833
4833
 
@@ -5866,9 +5866,6 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
5866
5866
  }
5867
5867
 
5868
5868
 
5869
- // 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)
5870
- if(ADD_CORS_HEADER) response.header('Access-Control-Allow-Origin', '*');
5871
-
5872
5869
 
5873
5870
  const urlFile="." + url;
5874
5871
 
@@ -5904,7 +5901,13 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
5904
5901
  // TRACE
5905
5902
  console.log("INFO 200 OK :"+filePath);
5906
5903
 
5907
- response.writeHead(200, { "Content-Type": contentType });
5904
+ const headers={ "Content-Type": contentType };
5905
+
5906
+ // 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)
5907
+ if(ADD_CORS_HEADER) headers["Access-Control-Allow-Origin"]="*";
5908
+
5909
+
5910
+ response.writeHead(200, headers);
5908
5911
  response.end(fileContent, "utf-8");
5909
5912
 
5910
5913
  // res.writeHead(200);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.305",
3
+ "version": "0.0.306",
4
4
  "main": "aotrautils-srv.build.js",
5
5
  "description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",