You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@liminal.apache.org by av...@apache.org on 2022/02/13 13:20:34 UTC

[incubator-liminal] branch master updated: [LIMINAL-25] Respond with 204 to favicon requests to python server

This is an automated email from the ASF dual-hosted git repository.

aviemzur pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-liminal.git


The following commit(s) were added to refs/heads/master by this push:
     new d1cb7a9  [LIMINAL-25] Respond with 204 to favicon requests to python server
d1cb7a9 is described below

commit d1cb7a92506c511c95a3afd2935e6806b50f2f07
Author: Simon Levin <si...@naturalint.com>
AuthorDate: Sun Feb 13 15:20:29 2022 +0200

    [LIMINAL-25] Respond with 204 to favicon requests to python server
---
 liminal/build/image/python_server/liminal_python_server.py            | 4 ++++
 .../airflow/build/http/python/test_python_server_image_builder.py     | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/liminal/build/image/python_server/liminal_python_server.py b/liminal/build/image/python_server/liminal_python_server.py
index 52708c6..1f91f22 100644
--- a/liminal/build/image/python_server/liminal_python_server.py
+++ b/liminal/build/image/python_server/liminal_python_server.py
@@ -45,6 +45,10 @@ if __name__ == '__main__':
 
     blueprint = Blueprint('liminal_python_server_blueprint', __name__)
 
+    @blueprint.route('/favicon.ico', methods=('GET', 'POST'))
+    def no_content():
+        return '', 204
+
     @blueprint.route('/', defaults={'endpoint': ''}, methods=('GET', 'POST'))
     @blueprint.route('/<endpoint>', methods=('GET', 'POST'))
     def show(endpoint):
diff --git a/tests/runners/airflow/build/http/python/test_python_server_image_builder.py b/tests/runners/airflow/build/http/python/test_python_server_image_builder.py
index 78e9ad0..25aa1a8 100644
--- a/tests/runners/airflow/build/http/python/test_python_server_image_builder.py
+++ b/tests/runners/airflow/build/http/python/test_python_server_image_builder.py
@@ -96,6 +96,10 @@ class TestPythonServer(TestCase):
 
         self.assertEqual(f'Input was: {json.loads(json_string)}', server_response)
 
+        server_favicon_response = urllib.request.urlopen('http://localhost:9294/favicon.ico')
+
+        self.assertEqual(204, server_favicon_response.status)
+
         self.__remove_containers()
 
         return build_out