aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs
diff options
context:
space:
mode:
authorcvium <clausvium@gmail.com>2022-01-07 10:23:22 +0100
committercvium <clausvium@gmail.com>2022-01-07 10:23:22 +0100
commitc658a883a2bc84b46ed73d209d2983e8a324cdce (patch)
treedabdbb5ac224e202d5433e7062e0c1b6872d1af7 /tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs
parent2899b77cd58456470b8dd4d01d3a8c525a9b5911 (diff)
parent6b4f5a86631e5bde93dae88553380c7ffd99b8e4 (diff)
Merge branch 'master' into keyframe_extraction_v1
# Conflicts: # Jellyfin.Api/Controllers/DynamicHlsController.cs # MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs # MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs')
-rw-r--r--tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs b/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs
index 4ea05397d..79c11a865 100644
--- a/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs
+++ b/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs
@@ -2,7 +2,7 @@ using System;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
-using System.Net.Mime;
+using System.Net.Http.Json;
using System.Text.Json;
using System.Threading.Tasks;
using Jellyfin.Api.Models.StartupDtos;
@@ -26,14 +26,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);