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

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

@ -915,7 +915,7 @@ def WebURLConnectFolder(inMethodStr, inURLStr, inMatchTypeStr, inFolderPathStr,
"MatchType": inMatchTypeStr, # "BeginWith|Contains|Equal|EqualCase",
# "ResponseFilePath": "", #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
"UACBool": inUACBool,
"UseCacheBool": inUseCacheBool
@ -923,7 +923,7 @@ def WebURLConnectFolder(inMethodStr, inURLStr, inMatchTypeStr, inFolderPathStr,
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
"inMethodStr":"GET|POST",
@ -936,7 +936,7 @@ def WebURLConnectFile(inMethodStr, inURLStr, inMatchTypeStr, inFilePathStr, inCo
:param inURLStr:
:param inMatchTypeStr:
: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 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
- - You can change the index page (def WebURLIndexChange)
- - Web server add EqualNoParam
- - Add support MIME WOFF2
- - MANAGERS
- - - ControlPanel
- - - Git CI

Loading…
Cancel
Save