mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
Change repeated array allocation into predefined constant
This commit is contained in:
@@ -60,6 +60,16 @@ public class SubsonicProxyService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ReadOnlySpan<string> StreamingRequiredHeaders =>
|
||||||
|
new
|
||||||
|
{
|
||||||
|
"Accept-Ranges",
|
||||||
|
"Content-Range",
|
||||||
|
"Content-Length",
|
||||||
|
"ETag",
|
||||||
|
"Last-Modified"
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Relays a stream request to the Subsonic server with range processing support.
|
/// Relays a stream request to the Subsonic server with range processing support.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -113,14 +123,7 @@ public class SubsonicProxyService
|
|||||||
outgoingResponse.StatusCode = (int)response.StatusCode;
|
outgoingResponse.StatusCode = (int)response.StatusCode;
|
||||||
|
|
||||||
// Forward streaming-required headers from upstream response
|
// Forward streaming-required headers from upstream response
|
||||||
foreach (var header in new[]
|
foreach (var header in StreamingRequiredHeaders)
|
||||||
{
|
|
||||||
"Accept-Ranges",
|
|
||||||
"Content-Range",
|
|
||||||
"Content-Length",
|
|
||||||
"ETag",
|
|
||||||
"Last-Modified"
|
|
||||||
})
|
|
||||||
{
|
{
|
||||||
if (response.Headers.TryGetValues(header, out var values) ||
|
if (response.Headers.TryGetValues(header, out var values) ||
|
||||||
response.Content.Headers.TryGetValues(header, out values))
|
response.Content.Headers.TryGetValues(header, out values))
|
||||||
|
|||||||
Reference in New Issue
Block a user