mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 19:37:55 +02:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using MediaBrowser.Common.Net.Handlers;
|
|
using MediaBrowser.Controller;
|
|
using System;
|
|
using System.ComponentModel.Composition;
|
|
using System.IO;
|
|
using System.Net;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MediaBrowser.Api.HttpHandlers
|
|
{
|
|
[Export(typeof(BaseHandler))]
|
|
class PluginAssemblyHandler : BaseHandler
|
|
{
|
|
public override bool HandlesRequest(HttpListenerRequest request)
|
|
{
|
|
return ApiService.IsApiUrlMatch("pluginassembly", request);
|
|
}
|
|
|
|
public override Task<string> GetContentType()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
protected override Task WriteResponseToOutputStream(Stream stream)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override Task ProcessRequest(HttpListenerContext ctx)
|
|
{
|
|
string filename = ctx.Request.QueryString["assemblyfilename"];
|
|
|
|
string path = Path.Combine(Kernel.Instance.ApplicationPaths.PluginsPath, filename);
|
|
|
|
return new StaticFileHandler { Path = path }.ProcessRequest(ctx);
|
|
}
|
|
}
|
|
}
|