aotrautils-srv 0.0.304 → 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-
|
|
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-
|
|
4830
|
+
/*utils SERVER library associated with aotra version : «1_29072022-2359 (03/12/2022-16:08:46)»*/
|
|
4831
4831
|
/*-----------------------------------------------------------------------------*/
|
|
4832
4832
|
|
|
4833
4833
|
|
|
@@ -5829,6 +5829,8 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
|
|
|
5829
5829
|
|
|
5830
5830
|
const EXCLUDED_FILENAMES_PARTS=[".keyHash."];
|
|
5831
5831
|
|
|
5832
|
+
const ADD_CORS_HEADER=true;
|
|
5833
|
+
|
|
5832
5834
|
|
|
5833
5835
|
if(typeof(https)==="undefined"){
|
|
5834
5836
|
// TRACE
|
|
@@ -5863,6 +5865,7 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
|
|
|
5863
5865
|
return;
|
|
5864
5866
|
}
|
|
5865
5867
|
|
|
5868
|
+
|
|
5866
5869
|
|
|
5867
5870
|
const urlFile="." + url;
|
|
5868
5871
|
|
|
@@ -5898,7 +5901,13 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
|
|
|
5898
5901
|
// TRACE
|
|
5899
5902
|
console.log("INFO 200 OK :"+filePath);
|
|
5900
5903
|
|
|
5901
|
-
|
|
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);
|
|
5902
5911
|
response.end(fileContent, "utf-8");
|
|
5903
5912
|
|
|
5904
5913
|
// res.writeHead(200);
|
aotrautils-srv/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
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)",
|