diff --git a/src/SipiHttpServer.cpp b/src/SipiHttpServer.cpp index 8deb1b38..6bb6b7df 100644 --- a/src/SipiHttpServer.cpp +++ b/src/SipiHttpServer.cpp @@ -637,7 +637,7 @@ static void serve_info_json_file(Connection &conn_obj, try { access = check_file_access(conn_obj, serv, luaserver, params, prefix_as_path); } catch (SipiError &err) { - send_error(conn_obj, Connection::INTERNAL_SERVER_ERROR, err); + send_error(conn_obj, Connection::NOT_FOUND, err); return; } diff --git a/test/e2e/test_02_server.py b/test/e2e/test_02_server.py index 95387617..266e5c5d 100644 --- a/test/e2e/test_02_server.py +++ b/test/e2e/test_02_server.py @@ -98,6 +98,11 @@ def test_deny(self, manager): manager.expect_status_code( "/knora/DenyLeaves.jpg/full/max/0/default.jpg", 401) + def test_not_found(self, manager): + """return 404 Not Found if the file is missing. Sipi will try and fail to find this file in the image directory.""" + manager.expect_status_code( + "/file-should-be-missing-123", 404) + def test_iiif_url_parsing(self, manager): """Return 400 for invalid IIIF URL's""" manager.expect_status_code("/unit//lena512.jp2", 400)