Skip to content

Handle ForbiddenResult and add Disposition to StreamCopyingResultHandler - #8

Merged
lewisrenfrew merged 1 commit into
mainfrom
stream-handler-forbidden-and-disposition
Aug 20, 2026
Merged

Handle ForbiddenResult and add Disposition to StreamCopyingResultHandler#8
lewisrenfrew merged 1 commit into
mainfrom
stream-handler-forbidden-and-disposition

Conversation

@lewisrenfrew

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI lite review requested due to automatic review settings August 20, 2026 16:15
@lewisrenfrew
lewisrenfrew merged commit 1af9d84 into main Aug 20, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the stream result handling pipeline to (1) correctly map ForbiddenResult<StreamResponse> to HTTP 403 responses and (2) allow callers to control Content-Disposition (inline vs attachment) when returning streamed content, with corresponding version/changelog updates.

Changes:

  • Add Disposition to StreamResponse and use it when setting the Content-Disposition header.
  • Handle ForbiddenResult<StreamResponse> explicitly in StreamCopyingResultHandler (return 403 and optional message body).
  • Add focused unit tests and bump package version/changelog accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/WhenCopyingStreamResult.cs Adds tests for stream copying, content disposition behavior, and 403 handling.
src/Linn.Common.Service.csproj Bumps library version to 3.2.0.
src/Handlers/StreamResponse.cs Introduces Disposition property (default inline).
src/Handlers/StreamCopyingResultHandler.cs Uses Disposition in Content-Disposition and adds 403 handling for forbidden results.
Linn.Common.Service.sln Updates solution metadata (VS version / SolutionGuid).
CHANGELOG.md Documents the 3.2.0 changes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +43 to +47
var disposition = string.IsNullOrEmpty(success.Data.Disposition)
? "inline"
: success.Data.Disposition;
res.Headers["Content-Disposition"] =
$"inline; filename=\"{success.Data.FileName}\"";
}
$"{disposition}; filename=\"{success.Data.FileName}\"";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants