Skip to content

refactor(core): centralize headers for streamable file responses#16627

Merged
kamilmysliwiec merged 1 commit intonestjs:masterfrom
ankitbelal:refactor/centralize-headers-and-parsers
Apr 3, 2026
Merged

refactor(core): centralize headers for streamable file responses#16627
kamilmysliwiec merged 1 commit intonestjs:masterfrom
ankitbelal:refactor/centralize-headers-and-parsers

Conversation

@ankitbelal
Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Currently, StreamableFile responses have headers set directly in multiple places in the ExpressAdapter, which leads to duplicate logic and ill maintained and lengthy method.

Issue Number: N/A

What is the new behavior?

Headers for StreamableFile responses are now centralized into private helper methods (setHeaderIfNotExists and applyStreamHeaders).
-Makes it easier to maintain and extend header logic in the future
-Reduce duplicate code

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

This is purely a refactor. No new features or bug fixes included.

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 6aed0320-689c-485f-812a-537dde8a983e

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.841%

Totals Coverage Status
Change from base Build 982ac74a-bb1f-4e45-9daf-0a5fe420033d: 0.0%
Covered Lines: 7473
Relevant Lines: 8318

💛 - Coveralls

@kamilmysliwiec kamilmysliwiec merged commit 0ca5440 into nestjs:master Apr 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants