mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
open static files read only
This commit is contained in:
@@ -66,10 +66,9 @@ namespace Jackett.Controllers
|
|||||||
{
|
{
|
||||||
var result = new HttpResponseMessage(HttpStatusCode.OK);
|
var result = new HttpResponseMessage(HttpStatusCode.OK);
|
||||||
var mappedPath = Path.Combine(config.GetContentFolder(), path);
|
var mappedPath = Path.Combine(config.GetContentFolder(), path);
|
||||||
var stream = new FileStream(mappedPath, FileMode.Open);
|
var stream = new FileStream(mappedPath, FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||||
result.Content = new StreamContent(stream);
|
result.Content = new StreamContent(stream);
|
||||||
result.Content.Headers.ContentType =
|
result.Content.Headers.ContentType = new MediaTypeHeaderValue(MimeMapping.GetMimeMapping(mappedPath));
|
||||||
new MediaTypeHeaderValue(MimeMapping.GetMimeMapping(mappedPath));
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user