ephraimbuddy commented on code in PR #28846:
URL: https://github.com/apache/airflow/pull/28846#discussion_r1066619689


##########
airflow/www/app.py:
##########
@@ -131,7 +132,29 @@ def create_app(config=None, testing=False):
 
     init_robots(flask_app)
 
+    # Configure caching
+    webserver_caching_hash_method = conf.get(section="webserver", 
key="CACHING_HASH_METHOD", fallback=None)
     cache_config = {"CACHE_TYPE": "flask_caching.backends.filesystem", 
"CACHE_DIR": gettempdir()}
+
+    if (
+        webserver_caching_hash_method is not None
+        and webserver_caching_hash_method.casefold() != "md5".casefold()
+    ):
+        if webserver_caching_hash_method.casefold() == "sha512".casefold():
+            cache_config["CACHE_OPTIONS"] = {"hash_method": hashlib.sha512}
+        elif webserver_caching_hash_method.casefold() == "sha384".casefold():
+            cache_config["CACHE_OPTIONS"] = {"hash_method": hashlib.sha384}
+        elif webserver_caching_hash_method.casefold() == "sha256".casefold():
+            cache_config["CACHE_OPTIONS"] = {"hash_method": hashlib.sha256}
+        elif webserver_caching_hash_method.casefold() == "sha224".casefold():

Review Comment:
   Are the RHS `casefolds` needed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to