Skip to content

Conversation

moumar
Copy link

@moumar moumar commented Oct 6, 2025

The headers customization is present in http serveDir but not in serveFile. This PR fixes this.

@moumar moumar requested a review from kt3k as a code owner October 6, 2025 19:39
@CLAassistant
Copy link

CLAassistant commented Oct 6, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the http label Oct 6, 2025
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.14%. Comparing base (76d8c7c) to head (7700f3d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6842   +/-   ##
=======================================
  Coverage   94.13%   94.14%           
=======================================
  Files         577      577           
  Lines       42556    42564    +8     
  Branches     6770     6772    +2     
=======================================
+ Hits        40062    40073   +11     
+ Misses       2442     2440    -2     
+ Partials       52       51    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

*
* @default {[]}
*/
headers?: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be a Headers interface. I also think the same can be said about serveDir.

@kt3k
Copy link
Member

kt3k commented Oct 7, 2025

The implementation looks good to me. However can you expose headers option only from unstable_file_server.ts for now? (We currently have the policy of not accepting new features directly to stable APIs https://github.com/denoland/std/blob/main/.github/CONTRIBUTING.md#suggesting-a-new-feature )

See how serveDir is exposed in unstable_file_server.ts for reference.

@moumar
Copy link
Author

moumar commented Oct 7, 2025

Sounds good to me. Let me update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants