From 6cbd22a2c294ef895cedf99043fc327dbadf51e3 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Tue, 24 May 2022 12:32:16 +0300 Subject: [PATCH] fixes --- Sources/pyOpenRPA/Orchestrator/Server.py | 5 +++-- Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py | 6 +++--- changelog.md | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Sources/pyOpenRPA/Orchestrator/Server.py b/Sources/pyOpenRPA/Orchestrator/Server.py index 8e115059..1f1d2da0 100644 --- a/Sources/pyOpenRPA/Orchestrator/Server.py +++ b/Sources/pyOpenRPA/Orchestrator/Server.py @@ -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] diff --git a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py index 1067e0a2..b47d891d 100644 --- a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py +++ b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py @@ -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 """ diff --git a/changelog.md b/changelog.md index 13fadc7b..09a1af81 100644 --- a/changelog.md +++ b/changelog.md @@ -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