Skip to content

Commit 805ec68

Browse files
Merge branch 'master' into dotnet-vnext
2 parents f6979f6 + b183d3f commit 805ec68

File tree

40 files changed

+281
-192
lines changed

40 files changed

+281
-192
lines changed

.config/dotnet-tools.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010
"rollForward": false
1111
},
1212
"markdownsnippets.tool": {
13-
"version": "28.0.1",
13+
"version": "28.1.0",
1414
"commands": [
1515
"mdsnippets"
1616
],
1717
"rollForward": false
1818
},
1919
"meziantou.framework.nugetpackagevalidation.tool": {
20-
"version": "1.0.45",
20+
"version": "1.0.46",
2121
"commands": [
2222
"meziantou.validate-nuget-package"
2323
],
2424
"rollForward": false
2525
},
2626
"microsoft.openapi.kiota": {
27-
"version": "1.30.0",
27+
"version": "1.31.1",
2828
"commands": [
2929
"kiota"
3030
],

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,20 @@ jobs:
100100
101101
- name: Upload Coverage Reports
102102
if: always()
103-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
103+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
104104
with:
105105
name: coverage-${{ runner.os }}
106106
path: ./artifacts/coverage
107107
if-no-files-found: ignore
108108

109109
- name: Upload coverage to Codecov
110-
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
110+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
111111
with:
112112
flags: ${{ runner.os }}
113113
token: ${{ secrets.CODECOV_TOKEN }}
114114

115115
- name: Upload test results to Codecov
116-
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
116+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
117117
if: ${{ !cancelled() }}
118118
with:
119119
flags: ${{ runner.os }}
@@ -142,7 +142,7 @@ jobs:
142142
./artifacts/package/release/*
143143
144144
- name: Publish NuGet packages
145-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
145+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
146146
if: ${{ !cancelled() }}
147147
with:
148148
name: packages-${{ runner.os }}

.github/workflows/bump-version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
8686
- name: Create pull request
8787
if: steps.push-changes.outputs.updated-version == 'true'
88-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
88+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
8989
env:
9090
BASE_BRANCH: ${{ github.event.repository.default_branch }}
9191
HEAD_BRANCH: ${{ steps.push-changes.outputs.branch-name }}
@@ -155,7 +155,7 @@ jobs:
155155
steps:
156156

157157
- name: Close milestone
158-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
158+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
159159
env:
160160
RELEASE_DATE: ${{ github.event.release.published_at }}
161161
RELEASE_VERSION: ${{ github.event.release.tag_name }}

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030
show-progress: false
3131

3232
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
33+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
3434
with:
3535
languages: csharp
3636
build-mode: none
3737

3838
- name: Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
39+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
4040
with:
4141
category: '/language:csharp'

.github/workflows/lint.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ permissions: {}
1616
env:
1717
FORCE_COLOR: 3
1818
TERM: xterm
19-
ZIZMOR_VERSION: '1.23.1'
2019

2120
jobs:
2221
lint:
@@ -45,20 +44,19 @@ jobs:
4544
args: -color
4645

4746
- name: Lint workflows with zizmor
48-
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2
47+
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3
4948
with:
5049
persona: pedantic
51-
version: ${{ env.ZIZMOR_VERSION }}
5250

5351
- name: Lint markdown
54-
uses: DavidAnson/markdownlint-cli2-action@07035fd053f7be764496c0f8d8f9f41f98305101 # v22.0.0
52+
uses: DavidAnson/markdownlint-cli2-action@ce4853d43830c74c1753b39f3cf40f71c2031eb9 # v23.0.0
5553
with:
5654
config: '.markdownlint.json'
5755
globs: |
5856
**/*.md
5957
6058
- name: Setup Node
61-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
59+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
6260
with:
6361
node-version: '24.x'
6462

.github/workflows/ossf-scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ jobs:
3434
results_format: sarif
3535

3636
- name: Upload artifact
37-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
37+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
3838
with:
3939
name: SARIF
4040
path: results.sarif
4141
retention-days: 5
4242

4343
- name: Upload to code-scanning
44-
uses: github/codeql-action/upload-sarif@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
44+
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
4545
with:
4646
sarif_file: results.sarif

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
"version=${version}" >> ${env:GITHUB_OUTPUT}
4343
4444
- name: Create release
45-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
45+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
4646
env:
4747
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
4848
DRAFT: ${{ inputs.publish != true }}

.github/workflows/update-documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
7474
- name: Create pull request
7575
if: steps.update-docs.outputs.updated-docs == 'true'
76-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
76+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
7777
env:
7878
BASE_BRANCH_NAME: ${{ github.event.repository.default_branch }}
7979
HEAD_BRANCH_NAME: ${{ steps.update-docs.outputs.branchName }}

Directory.Packages.props

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project>
22
<ItemGroup>
3-
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
3+
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="11.0.0" />
44
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
55
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
6-
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.2" />
6+
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.3" />
77
<PackageVersion Include="IdentityServer4" Version="3.1.4" />
88
<PackageVersion Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
99
<PackageVersion Include="JunitXml.TestLogger" Version="8.0.0" />
@@ -17,18 +17,18 @@
1717
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="4.14.0" />
1818
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="11.0.0-preview.3.26207.106" />
1919
<PackageVersion Include="Microsoft.Kiota.Bundle" Version="1.22.1" />
20-
<PackageVersion Include="Microsoft.OpenApi" Version="3.4.0" />
21-
<PackageVersion Include="Microsoft.OpenApi.YamlReader" Version="3.4.0" />
22-
<PackageVersion Include="Microsoft.Playwright" Version="1.58.0" />
23-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
20+
<PackageVersion Include="Microsoft.OpenApi" Version="3.5.2" />
21+
<PackageVersion Include="Microsoft.OpenApi.YamlReader" Version="3.5.2" />
22+
<PackageVersion Include="Microsoft.Playwright" Version="1.59.0" />
23+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
2424
<PackageVersion Include="MSBuild.ProjectCreation" Version="17.0.1" />
2525
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
26-
<PackageVersion Include="NJsonSchema" Version="11.5.2" />
26+
<PackageVersion Include="NJsonSchema" Version="11.6.0" />
2727
<PackageVersion Include="NSubstitute" Version="5.3.0" />
2828
<PackageVersion Include="NSwag.CodeGeneration.CSharp" Version="14.6.3" />
2929
<PackageVersion Include="NSwag.MSBuild" Version="14.6.3" />
3030
<PackageVersion Include="ReportGenerator" Version="5.5.4" />
31-
<PackageVersion Include="Verify.XunitV3" Version="31.13.5" />
31+
<PackageVersion Include="Verify.XunitV3" Version="31.15.0" />
3232
<PackageVersion Include="xunit" Version="2.9.3" />
3333
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
3434
<PackageVersion Include="xunit.v3.mtp-off" Version="3.2.2" />

src/Swashbuckle.AspNetCore.ReDoc/ReDocMiddleware.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Swashbuckle.AspNetCore.ReDoc;
1010

1111
internal sealed class ReDocMiddleware
1212
{
13+
private static readonly HashSet<string> AllowedHttpMethods = new(StringComparer.OrdinalIgnoreCase) { HttpMethods.Get, HttpMethods.Head };
1314
private static readonly string ReDocVersion = GetReDocVersion();
1415

1516
private readonly RequestDelegate _next;
@@ -37,7 +38,7 @@ public ReDocMiddleware(RequestDelegate next, ReDocOptions options)
3738

3839
public async Task Invoke(HttpContext httpContext)
3940
{
40-
if (HttpMethods.IsGet(httpContext.Request.Method))
41+
if (AllowedHttpMethods.Contains(httpContext.Request.Method))
4142
{
4243
var path = httpContext.Request.Path.Value;
4344

@@ -165,7 +166,15 @@ private async Task RespondWithFile(HttpContext context, string fileName)
165166

166167
SetHeaders(response, _options, etag);
167168

168-
await response.WriteAsync(text, Encoding.UTF8, cancellationToken);
169+
if (HttpMethods.IsGet(context.Request.Method))
170+
{
171+
await response.WriteAsync(text, Encoding.UTF8, cancellationToken);
172+
}
173+
else if (HttpMethods.IsHead(context.Request.Method))
174+
{
175+
// HEAD response must have an empty body, but have correct Content-Length header
176+
response.ContentLength = Encoding.UTF8.GetByteCount(text);
177+
}
169178
}
170179

171180
static string GetETag(string text)

0 commit comments

Comments
 (0)