Skip to content

Commit

Permalink
Cosmetic change
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Nov 25, 2021
1 parent e0dfa1f commit 8ccff70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/app-abspath.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Make sure /app/new takes `target` as absolute path

A mini-PR to make the `target` parameter absolute (by prepending `/` if missing).

https://github.com/cs3org/reva/pull/2305
7 changes: 4 additions & 3 deletions internal/http/services/ocmd/reqres.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ type APIError struct {
}

// WriteError handles writing error responses
func WriteError(w http.ResponseWriter, r *http.Request, code APIErrorCode, message string, err error) {
if err != nil {
appctx.GetLogger(r.Context()).Error().Err(err).Msg(message)
func WriteError(w http.ResponseWriter, r *http.Request, code APIErrorCode, message string, e error) {
if e != nil {
appctx.GetLogger(r.Context()).Error().Err(e).Msg(message)
}

var encoded []byte
var err error
w.Header().Set("Content-Type", "application/json")
encoded, err = json.MarshalIndent(APIError{Code: code, Message: message}, "", " ")

Expand Down

0 comments on commit 8ccff70

Please sign in to comment.