diff --git a/test/webapi/viewer/test_routes.py b/test/webapi/viewer/test_routes.py index e48cf9e44..0763c2e90 100644 --- a/test/webapi/viewer/test_routes.py +++ b/test/webapi/viewer/test_routes.py @@ -33,12 +33,12 @@ class ViewerStateRoutesNoConfigTest(RoutesTestCase): def test_get(self): response = self.fetch("/viewer/state") - self.assertEqual(504, response.status) + self.assertEqual(501, response.status) self.assertEqual("Persistence not supported", response.reason) def test_put(self): response = self.fetch("/viewer/state", method="PUT", body={"state": 123}) - self.assertEqual(504, response.status) + self.assertEqual(501, response.status) self.assertEqual("Persistence not supported", response.reason) diff --git a/xcube/webapi/viewer/routes.py b/xcube/webapi/viewer/routes.py index f9cd733fd..c159ddcef 100644 --- a/xcube/webapi/viewer/routes.py +++ b/xcube/webapi/viewer/routes.py @@ -124,7 +124,8 @@ class ViewerStateHandler(ApiHandler[ViewerContext]): ) def get(self): if self.ctx.persistence is None: - self.response.set_status(504, "Persistence not supported") + # 501: Not Implemented + self.response.set_status(501, "Persistence not supported") return key = self.request.get_query_arg("key", type=str, default="") if key: @@ -144,7 +145,8 @@ def get(self): ) def put(self): if self.ctx.persistence is None: - self.response.set_status(504, "Persistence not supported") + # 501: Not Implemented + self.response.set_status(501, "Persistence not supported") return state = self.request.body key = self.new_key()