From 4bf4965729c952ede1adb7701f7c4b3768059bfc Mon Sep 17 00:00:00 2001 From: Maxime Lagresle Date: Tue, 1 Oct 2024 10:01:03 +0200 Subject: [PATCH] add two headers --- internal/bitwarden/webapi/client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/bitwarden/webapi/client.go b/internal/bitwarden/webapi/client.go index 7c7f6e7..c12cdbc 100644 --- a/internal/bitwarden/webapi/client.go +++ b/internal/bitwarden/webapi/client.go @@ -282,6 +282,7 @@ func (c *client) LoginWithPassword(ctx context.Context, username, password strin return nil, fmt.Errorf("error preparing login with password request: %w", err) } httpReq.Header.Add("Auth-Email", base64.StdEncoding.EncodeToString([]byte(username))) + httpReq.Header.Add("Device-Type", c.deviceType) tokenResp, err := doRequest[TokenResponse](ctx, c.httpClient, httpReq) if err != nil { @@ -399,6 +400,7 @@ func (c *client) prepareRequest(ctx context.Context, reqMethod, reqUrl string, r if len(c.sessionAccessToken) > 0 { httpReq.Header.Add("authorization", fmt.Sprintf("Bearer %s", c.sessionAccessToken)) } + httpReq.Header.Add("Accept", "application/json") return httpReq, nil }