dev-linux
Ivan Maslov 2 years ago
parent 4aa21a68d2
commit 6cbd22a2c2

@ -27,6 +27,7 @@ from . import ServerSettings
from . import __Orchestrator__ from . import __Orchestrator__
import copy import copy
import mimetypes import mimetypes
mimetypes.add_type("font/woff2",".woff2")
gCacheDict = {} gCacheDict = {}
@ -280,7 +281,7 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
#If file path is set #If file path is set
if "ResponseFilePath" in inURLItem: if "ResponseFilePath" in inURLItem:
# Check cache # Check cache
if inURLItem.get("inUseCacheBool",False) == True: if inURLItem.get("UseCacheBool",False) == True:
if inURLItem["ResponseFilePath"] in gCacheDict: if inURLItem["ResponseFilePath"] in gCacheDict:
# Write content as utf-8 data # Write content as utf-8 data
inResponseDict["Body"] = gCacheDict[inURLItem["ResponseFilePath"]] inResponseDict["Body"] = gCacheDict[inURLItem["ResponseFilePath"]]
@ -321,7 +322,7 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
#Check if file exist #Check if file exist
if os.path.exists(lFilePath) and os.path.isfile(lFilePath): if os.path.exists(lFilePath) and os.path.isfile(lFilePath):
# Check cache # Check cache
if inURLItem.get("inUseCacheBool",False) == True: if inURLItem.get("UseCacheBool",False) == True:
if lFilePath in gCacheDict: if lFilePath in gCacheDict:
# Write content as utf-8 data # Write content as utf-8 data
inResponseDict["Body"] = gCacheDict[lFilePath] inResponseDict["Body"] = gCacheDict[lFilePath]

@ -915,7 +915,7 @@ def WebURLConnectFolder(inMethodStr, inURLStr, inMatchTypeStr, inFolderPathStr,
"MatchType": inMatchTypeStr, # "BeginWith|Contains|Equal|EqualCase", "MatchType": inMatchTypeStr, # "BeginWith|Contains|Equal|EqualCase",
# "ResponseFilePath": "", #Absolute or relative path # "ResponseFilePath": "", #Absolute or relative path
"ResponseFolderPath": lFolderPathStr, # Absolute or relative path "ResponseFolderPath": lFolderPathStr, # Absolute or relative path
"ResponseContentType": "application/octet-stream", #HTTP Content-type "ResponseContentType": None, #HTTP Content-type
#"ResponseDefRequestGlobal": inDef #Function with str result #"ResponseDefRequestGlobal": inDef #Function with str result
"UACBool": inUACBool, "UACBool": inUACBool,
"UseCacheBool": inUseCacheBool "UseCacheBool": inUseCacheBool
@ -923,7 +923,7 @@ def WebURLConnectFolder(inMethodStr, inURLStr, inMatchTypeStr, inFolderPathStr,
inGSettings["ServerDict"]["URLList"].append(lURLItemDict) inGSettings["ServerDict"]["URLList"].append(lURLItemDict)
def WebURLConnectFile(inMethodStr, inURLStr, inMatchTypeStr, inFilePathStr, inContentTypeStr="application/octet-stream", inGSettings = None, inUACBool = None, inUseCacheBool = False): def WebURLConnectFile(inMethodStr, inURLStr, inMatchTypeStr, inFilePathStr, inContentTypeStr=None, inGSettings = None, inUACBool = None, inUseCacheBool = False):
""" """
Connect URL to File Connect URL to File
"inMethodStr":"GET|POST", "inMethodStr":"GET|POST",
@ -936,7 +936,7 @@ def WebURLConnectFile(inMethodStr, inURLStr, inMatchTypeStr, inFilePathStr, inCo
:param inURLStr: :param inURLStr:
:param inMatchTypeStr: :param inMatchTypeStr:
:param inFilePathStr: :param inFilePathStr:
:param inContentTypeStr: :param inContentTypeStr: If none - autodetect
:param inUACBool: default: None; True - check user access before do this URL item. None - get Server flag if ask user :param inUACBool: default: None; True - check user access before do this URL item. None - get Server flag if ask user
:param inUseCacheBool: True - cache this page - dont open ever :param inUseCacheBool: True - cache this page - dont open ever
""" """

@ -12,6 +12,7 @@ AGT - AGENT
- - Raise debug session from production. Support init_debug file in working directory - - Raise debug session from production. Support init_debug file in working directory
- - You can change the index page (def WebURLIndexChange) - - You can change the index page (def WebURLIndexChange)
- - Web server add EqualNoParam - - Web server add EqualNoParam
- - Add support MIME WOFF2
- - MANAGERS - - MANAGERS
- - - ControlPanel - - - ControlPanel
- - - Git CI - - - Git CI

Loading…
Cancel
Save