From a1efe4caca8cc444f9d3caa6a45edea7e959c41a Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Sat, 27 Jul 2019 19:55:18 +0200 Subject: [PATCH] Add DLNA headers if requested by the client. And remove the code which adds the headers as ResponseHelper.WriteToResponse will do it. --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 3994016240..4a198661cc 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -690,8 +690,8 @@ namespace MediaBrowser.Api.Playback request.AudioCodec = EncodingHelper.InferAudioCodec(url); } - var enableDlnaHeaders = !string.IsNullOrWhiteSpace(request.Params) /*|| - string.Equals(Request.Headers.Get("GetContentFeatures.DLNA.ORG"), "1", StringComparison.OrdinalIgnoreCase)*/; + var enableDlnaHeaders = !string.IsNullOrWhiteSpace(request.Params) || + string.Equals(GetHeader("GetContentFeatures.DLNA.ORG"), "1", StringComparison.OrdinalIgnoreCase); var state = new StreamState(MediaSourceManager, TranscodingJobType) { @@ -1016,11 +1016,6 @@ namespace MediaBrowser.Api.Playback ).FirstOrDefault() ?? string.Empty; } - - foreach (var item in responseHeaders) - { - Request.Response.AddHeader(item.Key, item.Value); - } } private void AddTimeSeekResponseHeaders(StreamState state, IDictionary responseHeaders)