From e082e26be8205aa9788c4c4c3a02d8a828a6f4d6 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Wed, 11 Sep 2024 11:01:14 -0600 Subject: [PATCH 1/2] Do not include full error message with file paths when returning a 404 from opendap --- tds/src/main/java/thredds/server/opendap/OpendapServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tds/src/main/java/thredds/server/opendap/OpendapServlet.java b/tds/src/main/java/thredds/server/opendap/OpendapServlet.java index 733e88bb08..afe7de04fc 100644 --- a/tds/src/main/java/thredds/server/opendap/OpendapServlet.java +++ b/tds/src/main/java/thredds/server/opendap/OpendapServlet.java @@ -203,7 +203,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) { // plain ol' 404 } catch (FileNotFoundException e) { // e.printStackTrace(); - sendErrorResponse(response, HttpServletResponse.SC_NOT_FOUND, e.getMessage()); + sendErrorResponse(response, HttpServletResponse.SC_NOT_FOUND, "FileNotFound: No such file or directory"); // DAP2Exception bad url } catch (BadURLException e) { From 21b3e2cbdfb9ea3611107de41391a0c6981529d6 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Thu, 12 Sep 2024 12:01:42 -0600 Subject: [PATCH 2/2] Fix WFS exception to not include query parameters --- tds/src/main/java/thredds/server/wfs/WFSController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tds/src/main/java/thredds/server/wfs/WFSController.java b/tds/src/main/java/thredds/server/wfs/WFSController.java index 75fe8bdcbc..6cce499a38 100644 --- a/tds/src/main/java/thredds/server/wfs/WFSController.java +++ b/tds/src/main/java/thredds/server/wfs/WFSController.java @@ -261,8 +261,8 @@ private WFSExceptionWriter checkParametersForError(String request, String versio // Last check to see if typenames is specified, must be for GetFeature, DescribeFeatureType if (typeName == null) { return new WFSExceptionWriter( - "WFS server error. For the specifed request, parameter typename or typenames must be specified.", request, - "MissingParameterValue"); + "WFS server error. For the specifed request, parameter typename or typenames must be specified.", + "request", "MissingParameterValue"); } }