fixed theme and language controller not setting no-cache, no-store header
This commit is contained in:
parent
96d589df54
commit
3960484ce8
|
@ -7,6 +7,7 @@ namespace Wave.Controllers;
|
||||||
[Route("/language")]
|
[Route("/language")]
|
||||||
public class LanguageController : ControllerBase {
|
public class LanguageController : ControllerBase {
|
||||||
[HttpGet("{culture}")]
|
[HttpGet("{culture}")]
|
||||||
|
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
|
||||||
public IActionResult SetLanguage(string culture, string returnUrl = "") {
|
public IActionResult SetLanguage(string culture, string returnUrl = "") {
|
||||||
Response.Cookies.Append(
|
Response.Cookies.Append(
|
||||||
CookieRequestCultureProvider.DefaultCookieName,
|
CookieRequestCultureProvider.DefaultCookieName,
|
||||||
|
|
|
@ -6,12 +6,14 @@ namespace Wave.Controllers;
|
||||||
[Route("/theme")]
|
[Route("/theme")]
|
||||||
public class ThemeController : ControllerBase {
|
public class ThemeController : ControllerBase {
|
||||||
[HttpGet("")]
|
[HttpGet("")]
|
||||||
|
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
|
||||||
public IActionResult SetTheme(string returnUrl = "") {
|
public IActionResult SetTheme(string returnUrl = "") {
|
||||||
Response.Cookies.Delete(".Wave.Theme");
|
Response.Cookies.Delete(".Wave.Theme");
|
||||||
return LocalRedirect(string.IsNullOrWhiteSpace(returnUrl) ? "/" : returnUrl);
|
return LocalRedirect(string.IsNullOrWhiteSpace(returnUrl) ? "/" : returnUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{theme}")]
|
[HttpGet("{theme}")]
|
||||||
|
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
|
||||||
public IActionResult SetTheme(string? theme, string returnUrl = "") {
|
public IActionResult SetTheme(string? theme, string returnUrl = "") {
|
||||||
if (theme is null) {
|
if (theme is null) {
|
||||||
Response.Cookies.Delete(".Wave.Theme");
|
Response.Cookies.Delete(".Wave.Theme");
|
||||||
|
|
Loading…
Reference in a new issue