From 33bb6b6b363ce2992a932248eed21a6776b48ef9 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Tue, 13 Feb 2024 14:48:38 +0545 Subject: [PATCH] fix: bulky error message for invalid search request --- changelog/unreleased/fix-search-error-message.md | 5 +++++ services/webdav/pkg/service/v0/search.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/fix-search-error-message.md diff --git a/changelog/unreleased/fix-search-error-message.md b/changelog/unreleased/fix-search-error-message.md new file mode 100644 index 00000000000..61d799d601d --- /dev/null +++ b/changelog/unreleased/fix-search-error-message.md @@ -0,0 +1,5 @@ +Bugfix: Fix search error message + +When fixed the error message returned when the search request is invalid + +https://github.com/owncloud/ocis/issues/8442 diff --git a/services/webdav/pkg/service/v0/search.go b/services/webdav/pkg/service/v0/search.go index 848b77f226b..94c2efbb5c0 100644 --- a/services/webdav/pkg/service/v0/search.go +++ b/services/webdav/pkg/service/v0/search.go @@ -78,7 +78,7 @@ func (g Webdav) Search(w http.ResponseWriter, r *http.Request) { e := merrors.Parse(err.Error()) switch e.Code { case http.StatusBadRequest: - renderError(w, r, errBadRequest(err.Error())) + renderError(w, r, errBadRequest(e.Detail)) default: renderError(w, r, errInternalError(err.Error())) }