Skip to content

Commit

Permalink
[fix] missing Set content type text/plain for all string responses …
Browse files Browse the repository at this point in the history
…by default for shortcut methods
  • Loading branch information
i4004 committed Dec 20, 2023
1 parent c821d8f commit d820c20
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/Simplify.Web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Simplify.Web/ControllerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class ControllerBase : ActionModulesAccessor
/// <param name="content">The string content.</param>
/// <param name="statusCode">The HTTP response status code.</param>
/// <param name="contentType">Type of the content.</param>
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);

/// <summary>
/// Initializes a new instance of the <see cref="Responses.Content" /> class.
Expand Down Expand Up @@ -119,7 +119,7 @@ public abstract class ControllerBase : ActionModulesAccessor
/// <param name="statusCode">The HTTP response status code.</param>
/// <param name="responseData">The response data.</param>
/// <param name="contentType">Type of the content.</param>
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);

/// <summary>
/// Initializes a new instance of the <see cref="ViewModel{T}" /> class.
Expand Down
2 changes: 1 addition & 1 deletion src/Simplify.Web/Simplify.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<Version>4.8</Version>
<Version>4.8.1</Version>

<Authors>Alexander Krylkov</Authors>
<Product>Simplify</Product>
Expand Down

0 comments on commit d820c20

Please sign in to comment.