From d820c2028415890ccc1b6322113df8726a4ea441 Mon Sep 17 00:00:00 2001 From: Alexanderius Date: Wed, 20 Dec 2023 14:38:21 +0600 Subject: [PATCH] [fix] missing Set content type `text/plain` for all string responses by default for shortcut methods --- src/Simplify.Web/CHANGELOG.md | 6 ++++++ src/Simplify.Web/ControllerBase.cs | 4 ++-- src/Simplify.Web/Simplify.Web.csproj | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Simplify.Web/CHANGELOG.md b/src/Simplify.Web/CHANGELOG.md index ef81a3c8..089a2d6d 100644 --- a/src/Simplify.Web/CHANGELOG.md +++ b/src/Simplify.Web/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [4.8.1] - 2023-12-20 + +### Fixed + +- Missing Set content type `text/plain` for all string responses by default for shortcut methods (#247) + ## [4.8.0] - 2023-12-20 ### Changed diff --git a/src/Simplify.Web/ControllerBase.cs b/src/Simplify.Web/ControllerBase.cs index 2980ae92..0a84a208 100644 --- a/src/Simplify.Web/ControllerBase.cs +++ b/src/Simplify.Web/ControllerBase.cs @@ -28,7 +28,7 @@ public abstract class ControllerBase : ActionModulesAccessor /// The string content. /// The HTTP response status code. /// Type of the content. - protected Content Content(string content, int statusCode = 200, string contentType = null) => new(content, statusCode, contentType); + protected Content Content(string content, int statusCode = 200, string contentType = "text/plain") => new(content, statusCode, contentType); /// /// Initializes a new instance of the class. @@ -119,7 +119,7 @@ public abstract class ControllerBase : ActionModulesAccessor /// The HTTP response status code. /// The response data. /// Type of the content. - protected StatusCode StatusCode(int statusCode, string responseData = null, string contentType = null) => new(statusCode, responseData, contentType); + protected StatusCode StatusCode(int statusCode, string responseData = null, string contentType = "text/plain") => new(statusCode, responseData, contentType); /// /// Initializes a new instance of the class. diff --git a/src/Simplify.Web/Simplify.Web.csproj b/src/Simplify.Web/Simplify.Web.csproj index 86cb7cc7..97ba2249 100644 --- a/src/Simplify.Web/Simplify.Web.csproj +++ b/src/Simplify.Web/Simplify.Web.csproj @@ -9,7 +9,7 @@ snupkg true - 4.8 + 4.8.1 Alexander Krylkov Simplify