Skip to content

Commit

Permalink
Merge pull request #4216 from 2403905/OCIS-3809-upd
Browse files Browse the repository at this point in the history
error msg updated
  • Loading branch information
2403905 committed Sep 25, 2023
2 parents 863657f + 3d95631 commit 22d6a27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-banned-password.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix an error message

Capitalize an error message for Banned-Passwords List OCIS-3809

https://github.com/cs3org/reva/pull/4216
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/hashicorp/go-hclog v1.3.1
github.com/hashicorp/go-plugin v1.4.5
github.com/huandu/xstrings v1.3.2
github.com/iancoleman/strcase v0.2.0
github.com/jedib0t/go-pretty v4.3.0+incompatible
github.com/jellydator/ttlcache/v2 v2.11.1
Expand Down Expand Up @@ -147,7 +148,6 @@ require (
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/serf v0.10.0 // indirect
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
"github.com/huandu/xstrings"
"github.com/rs/zerolog/log"

"github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/conversions"
Expand Down Expand Up @@ -153,7 +154,7 @@ func (h *Handler) createPublicLinkShare(w http.ResponseWriter, r *http.Request,
if err := h.passwordValidator.Validate(password); err != nil {
return nil, &ocsError{
Code: response.MetaBadRequest.StatusCode,
Message: err.Error(),
Message: xstrings.FirstRuneToUpper(err.Error()),
Error: fmt.Errorf("password validation failed: %w", err),
}
}
Expand Down Expand Up @@ -479,7 +480,7 @@ func (h *Handler) updatePublicShare(w http.ResponseWriter, r *http.Request, shar
// skip validation if the clear password scenario
if len(newPassword[0]) > 0 {
if err := h.passwordValidator.Validate(newPassword[0]); err != nil {
response.WriteOCSError(w, r, response.MetaBadRequest.StatusCode, err.Error(), err)
response.WriteOCSError(w, r, response.MetaBadRequest.StatusCode, xstrings.FirstRuneToUpper(err.Error()), err)
return
}
}
Expand Down

0 comments on commit 22d6a27

Please sign in to comment.