denoland / denoland/std

suggestion(http): change `ServeDirOptions.headers` to accept `HeadersInit` instead of `string[]`

Open
#6,723 1 comment 4 reactions 0 assignees View on GitHub
bug needs triage
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

It surprised me when I discovered `serveDir()` accepted `string[]` instead of `HeadersInit` as an option. It makes the user write needlessly write a raw header. I suggest we change this in `@std/http/unstable-file-server` without changing the CLI behaviour.

API reference: https://jsr.io/@std/http/doc/~/ServeDirOptions.headers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.