let static files in peace
This commit is contained in:
parent
26b5d4bdf4
commit
46f0da427a
1 changed files with 3 additions and 1 deletions
|
|
@ -35,13 +35,15 @@ namespace Yavsc
|
|||
UserFilesOptions.EnableDefaultFiles=true;
|
||||
UserFilesOptions.StaticFileOptions.ServeUnknownFileTypes=true;
|
||||
|
||||
UserFilesOptions.StaticFileOptions.OnPrepareResponse += async context =>
|
||||
/* TODO needs a better design, at implementation time (don't use database, but in memory data)
|
||||
UserFilesOptions.StaticFileOptions.OnPrepareResponse += async context =>
|
||||
{
|
||||
var uname = context.Context.User.GetUserName();
|
||||
var path = context.Context.Request.Path;
|
||||
var result = await authorizationService.AuthorizeAsync(context.Context.User, new ViewFileContext
|
||||
{ UserName = uname, File = context.File, Path = path } , new ViewRequirement());
|
||||
};
|
||||
*/
|
||||
var avatarsDirInfo = new DirectoryInfo(Startup.SiteSetup.Avatars);
|
||||
if (!avatarsDirInfo.Exists) avatarsDirInfo.Create();
|
||||
AvatarsDirName = avatarsDirInfo.FullName;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue