Skip to content

Commit d820c20

Browse files
committed
[fix] missing Set content type text/plain for all string responses by default for shortcut methods
1 parent c821d8f commit d820c20

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/Simplify.Web/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [4.8.1] - 2023-12-20
4+
5+
### Fixed
6+
7+
- Missing Set content type `text/plain` for all string responses by default for shortcut methods (#247)
8+
39
## [4.8.0] - 2023-12-20
410

511
### Changed

src/Simplify.Web/ControllerBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public abstract class ControllerBase : ActionModulesAccessor
2828
/// <param name="content">The string content.</param>
2929
/// <param name="statusCode">The HTTP response status code.</param>
3030
/// <param name="contentType">Type of the content.</param>
31-
protected Content Content(string content, int statusCode = 200, string contentType = null) => new(content, statusCode, contentType);
31+
protected Content Content(string content, int statusCode = 200, string contentType = "text/plain") => new(content, statusCode, contentType);
3232

3333
/// <summary>
3434
/// Initializes a new instance of the <see cref="Responses.Content" /> class.
@@ -119,7 +119,7 @@ public abstract class ControllerBase : ActionModulesAccessor
119119
/// <param name="statusCode">The HTTP response status code.</param>
120120
/// <param name="responseData">The response data.</param>
121121
/// <param name="contentType">Type of the content.</param>
122-
protected StatusCode StatusCode(int statusCode, string responseData = null, string contentType = null) => new(statusCode, responseData, contentType);
122+
protected StatusCode StatusCode(int statusCode, string responseData = null, string contentType = "text/plain") => new(statusCode, responseData, contentType);
123123

124124
/// <summary>
125125
/// Initializes a new instance of the <see cref="ViewModel{T}" /> class.

src/Simplify.Web/Simplify.Web.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1010
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1111

12-
<Version>4.8</Version>
12+
<Version>4.8.1</Version>
1313

1414
<Authors>Alexander Krylkov</Authors>
1515
<Product>Simplify</Product>

0 commit comments

Comments
 (0)