Add the client script while index.html is served

Writing the tag into index.html on disk fails on most fresh installs
(linuxserver image, distro packages, Docker as a normal user) because
the web files belong to root. A middleware now adds the tag to the
response instead, so the ShareLink action and the guest lockdown work
right after install. The on-disk edit stays as a best-effort extra, and
the tag uses a relative src so it also works under a base URL.

Bump to 1.0.8.0.
Cette révision appartient à :
Francois CB
2026-09-18 16:31:45 +02:00
Parent 21ca14b780
révision 1c7acfe185
6 fichiers modifiés avec 155 ajouts et 10 suppressions
+21
Voir le fichier
@@ -0,0 +1,21 @@
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
namespace Jellyfin.Plugin.ShareLinks.Web;
/// <summary>
/// Puts <see cref="IndexHtmlScriptMiddleware"/> in front of Jellyfin's own pipeline.
/// </summary>
public sealed class IndexHtmlScriptStartupFilter : IStartupFilter
{
/// <inheritdoc />
public Action<IApplicationBuilder> Configure(Action<IApplicationBuilder> next)
{
return app =>
{
app.UseMiddleware<IndexHtmlScriptMiddleware>();
next(app);
};
}
}