From 3a0510d6b41326c597da366766cf4c2cd5f5700a Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Fri, 14 Apr 2023 19:20:35 +0200 Subject: [PATCH] [PS-2507] Enable firefox relay address on creation (#2474) * Enable firefox relay address on creation Adding a body (json) to the request and setting enabled to true. Additionally the description is set to "Generated by Bitwarden." to mimick the behaviour of the other clients * Add missing encoding and mediaType * Replace JObject with anonymous type --- src/Core/Services/ApiService.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Core/Services/ApiService.cs b/src/Core/Services/ApiService.cs index 66587b4a0..eebebdae0 100644 --- a/src/Core/Services/ApiService.cs +++ b/src/Core/Services/ApiService.cs @@ -767,6 +767,12 @@ namespace Bit.Core.Services break; case ForwardedEmailServiceType.FirefoxRelay: requestMessage.Headers.Add("Authorization", $"Token {config.ApiToken}"); + requestMessage.Content = new StringContent(JsonConvert.SerializeObject( + new + { + enabled = true, + description = "Generated by Bitwarden." + }), Encoding.UTF8, "application/json"); break; case ForwardedEmailServiceType.SimpleLogin: requestMessage.Headers.Add("Authentication", config.ApiToken);