mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-07-13 09:02:09 -04:00
groupware: refactoring the API mechanisms
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/log"
|
||||
@@ -127,6 +128,15 @@ func (h *HttpJmapApiClient) Command(ctx context.Context, logger *log.Logger, ses
|
||||
req.Header.Add("User-Agent", h.userAgent)
|
||||
h.auth(session.Username, logger, req)
|
||||
|
||||
{
|
||||
if logger.Trace().Enabled() {
|
||||
safereq := req.Clone(ctx)
|
||||
safereq.Header.Set("Authorization", "***")
|
||||
bytes, _ := httputil.DumpRequest(safereq, false)
|
||||
logger.Info().Msgf("sending command: %s", string(bytes))
|
||||
}
|
||||
}
|
||||
|
||||
res, err := h.client.Do(req)
|
||||
if err != nil {
|
||||
logger.Error().Err(err).Msgf("failed to perform POST %v", jmapUrl)
|
||||
|
||||
Reference in New Issue
Block a user