diff options
| author | Cody Robibero <cody@robibe.ro> | 2021-12-02 06:55:28 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-02 06:55:28 -0700 |
| commit | b1025121b8832cbabcaf5e667f865301b570345f (patch) | |
| tree | bebca148da808a13cfd2fabcd832c1c07b6973b6 /tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs | |
| parent | 2029076ce8e26e071c6d13b9c6256ee43051e4b5 (diff) | |
| parent | 40be86eec0fa7f43b64d05f30adcfab88ad3c402 (diff) | |
Merge pull request #6929 from Bond-009/jsoncontent
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs')
| -rw-r--r-- | tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs b/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs index 4ea05397d..4c8f64d1e 100644 --- a/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs +++ b/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs @@ -1,6 +1,7 @@ using System; using System.Net; using System.Net.Http; +using System.Net.Http.Json; using System.Net.Http.Headers; using System.Net.Mime; using System.Text.Json; @@ -26,14 +27,13 @@ namespace Jellyfin.Server.Integration.Tests using var completeResponse = await client.PostAsync("/Startup/Complete", new ByteArrayContent(Array.Empty<byte>())).ConfigureAwait(false); Assert.Equal(HttpStatusCode.NoContent, completeResponse.StatusCode); - using var content = new ByteArrayContent(JsonSerializer.SerializeToUtf8Bytes( + using var content = JsonContent.Create( new AuthenticateUserByName() { Username = user!.Name, Pw = user.Password, }, - jsonOptions)); - content.Headers.ContentType = MediaTypeHeaderValue.Parse(MediaTypeNames.Application.Json); + options: jsonOptions); content.Headers.Add("X-Emby-Authorization", DummyAuthHeader); using var authResponse = await client.PostAsync("/Users/AuthenticateByName", content).ConfigureAwait(false); |
