• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Kikobeats / send-http / 40660997275
100%

Build:
DEFAULT BRANCH: master
Ran 28 Oct 2026 09:01AM UTC
Jobs 1
Files 1
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Oct 2026 09:01AM UTC coverage: 100.0%. Remained the same
40660997275

push

github

web-flow
perf(require): load the content-type sniffer on first use (#30)

* perf(require): load the content-type sniffer on first use

`@kikobeats/set-content-type` pulls in `file-type` (ESM, plus debug,
token-types, strtok3, uint8array-extras), which was most of the cost of
`require('send-http')`. Only streams without a content-type need it, so it
is now required on the first sniff. Sending strings, objects, buffers and
preset-type streams never loads it.

Local A/B, alternating, 6 runs per side, median of medians (ms):

| case | base | change | delta | base range | change range |
|---|---|---|---|---|---|
| cold require | 14.0 | 1.2 | -91.4% | 12.5-14.1 | 0.1-1.6 |
| send string | 126.5 | 130.9 | +3.5% | 123.8-128.2 | 125.9-135.8 |
| send object | 151.8 | 153.1 | +0.9% | 150.1-155.4 | 151.2-154.9 |
| send buffer | 132.7 | 132.7 | 0.0% | 127.3-133.5 | 129.0-135.4 |
| sendStream sniffed | 149.2 | 148.9 | -0.2% | 144.6-151.4 | 143.4-152.2 |
| sendStream preset type | 103.8 | 103.6 | -0.2% | 102.2-104.9 | 99.9-105.8 |

node v24.16.0, arm64, load avg 3.8-4.8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: drop comment on lazy sniffer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: destroy the source when the sniffer fails to load

The lazy require is evaluated before pipeline starts, so a throw never
attaches the source. On a deferred proxy that throw escapes the upstream
response listener. Destroy the source and report it through onError, the
same path as any other stream failure.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: report a sniffer failure on an already-destroyed source

stream.destroy(error) emits nothing when the source is already destroyed,
so onError never ran and the response stayed open. Call the same once-only
reporter directly in that case.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test: split sniffer failure cases

One test held every failure path. Each case is its own serial test s... (continued)

66 of 66 branches covered (100.0%)

Branch coverage included in aggregate %.

33 of 33 new or added lines in 1 file covered. (100.0%)

178 of 178 relevant lines covered (100.0%)

54.15 hits per line

Jobs
ID Job ID Ran Files Coverage
1 40660997275.1 28 Oct 2026 09:01AM UTC 1
100.0
GitHub Action Run
Source Files on build 40660997275
  • Tree
  • List 1
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #40660997275
  • 8b94f4a3 on github
  • Prev Build on master (#40563717268)
  • Next Build on master (#40670744171)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc