aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs
diff options
context:
space:
mode:
authorJonas Resch <jonas.resch@live.de>2021-12-08 09:55:16 +0100
committerJonas Resch <jonas.resch@live.de>2021-12-08 09:55:16 +0100
commit87a6fdf8478cf8daa24dc44a2a3da451be06b950 (patch)
treec5d147e9f05ee5e1c28094236f0a4caa7bab9069 /tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs
parentca2d94ee97b53a69f4508f4ef5ac72a72d2a3aa5 (diff)
parenta327b43ab7faceadb555890c41f103008fc00737 (diff)
Merge branch 'support-external-audio-files' of github.com:jonas-resch/jellyfin into support-external-audio-files
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs')
-rw-r--r--tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs6
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);