* Add Gzip and Deflate Support to WebListener * [Feature] Run Feature tests * [Feature] Address PR Feedback * [Feature] Re-Run CI * [feature] Update WebListener Index page * [Feature] Run Feature tests * [Feature] Re-run CI
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using mvc.Models;
|
|
|
|
namespace mvc.Controllers
|
|
{
|
|
public class CompressionController : Controller
|
|
{
|
|
public ActionResult Index()
|
|
{
|
|
string url = "/Compression/Gzip";
|
|
ViewData["Url"] = url;
|
|
Response.Redirect(url, false);
|
|
return View("~/Views/Redirect/Index.cshtml");
|
|
}
|
|
|
|
[GzipFilter]
|
|
public JsonResult Gzip()
|
|
{
|
|
var getController = new GetController();
|
|
getController.ControllerContext = this.ControllerContext;
|
|
return getController.Index();
|
|
}
|
|
|
|
[DeflateFilter]
|
|
public JsonResult Deflate()
|
|
{
|
|
var getController = new GetController();
|
|
getController.ControllerContext = this.ControllerContext;
|
|
return getController.Index();
|
|
}
|
|
|
|
public IActionResult Error()
|
|
{
|
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
|
}
|
|
}
|
|
}
|