Browse Source

Fixed logo and favicon loading.

core
Teknikode 4 years ago
parent
commit
af6ffcaf6d
  1. 10
      Teknik/Controllers/DefaultController.cs
  2. 4
      Utilities/Constants.cs

10
Teknik/Controllers/DefaultController.cs

@ -58,8 +58,9 @@ namespace Teknik.Controllers @@ -58,8 +58,9 @@ namespace Teknik.Controllers
[ResponseCache(Duration = 31536000, Location = ResponseCacheLocation.Any)]
public IActionResult Favicon([FromServices] IHostingEnvironment env)
{
//string imageFile = FileHelper.MapPath(env, Constants.FAVICON_PATH);
return File(Constants.FAVICON_PATH, "image/x-icon");
string imageFile = FileHelper.MapPath(env, Constants.FAVICON_PATH);
FileStream fs = new FileStream(imageFile, FileMode.Open, FileAccess.Read);
return File(fs, "image/x-icon");
}
// Get the Logo
@ -68,8 +69,9 @@ namespace Teknik.Controllers @@ -68,8 +69,9 @@ namespace Teknik.Controllers
[ResponseCache(Duration = 31536000, Location = ResponseCacheLocation.Any)]
public IActionResult Logo([FromServices] IHostingEnvironment env)
{
//string imageFile = FileHelper.MapPath(env, Constants.LOGO_PATH);
return File(Constants.LOGO_PATH, "image/svg+xml");
string imageFile = FileHelper.MapPath(env, Constants.LOGO_PATH);
FileStream fs = new FileStream(imageFile, FileMode.Open, FileAccess.Read);
return File(fs, "image/svg+xml");
}
// Get the Robots.txt

4
Utilities/Constants.cs

@ -4,8 +4,8 @@ namespace Teknik.Utilities @@ -4,8 +4,8 @@ namespace Teknik.Utilities
{
public const string SERVERUSER = "Server Admin";
public const string TRUSTEDDEVICECOOKIE = "TeknikTrustedDevice";
public const string LOGO_PATH = "~/Images/logo-black.svg";
public const string FAVICON_PATH = "~/Images/favicon.ico";
public const string LOGO_PATH = "images/logo-black.svg";
public const string FAVICON_PATH = "images/favicon.ico";
public const string ROBOTS_PATH = "~/App_Data/robots.txt";
public const string LOG_FILE_NAME_PREFIX = "Teknik";
public const string LOG_FILE_EXT = ".log";

Loading…
Cancel
Save