Skip to content

Comments

Clear content-length if response body has indeterminate length#779

Merged
adam-fowler merged 2 commits intomainfrom
response-body-fix
Feb 2, 2026
Merged

Clear content-length if response body has indeterminate length#779
adam-fowler merged 2 commits intomainfrom
response-body-fix

Conversation

@adam-fowler
Copy link
Member

Missed the second fix when setting a response body. If previously the response had a content-length header and the new response body is of indeterminate length we should clear the content-length header

@adam-fowler adam-fowler requested a review from Joannis as a code owner January 31, 2026 11:01
@codecov
Copy link

codecov bot commented Jan 31, 2026

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.95%. Comparing base (d491220) to head (ed61cb4).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Sources/HummingbirdCore/Response/Response.swift 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #779      +/-   ##
==========================================
- Coverage   83.03%   82.95%   -0.08%     
==========================================
  Files         124      124              
  Lines        6182     6185       +3     
==========================================
- Hits         5133     5131       -2     
- Misses       1049     1054       +5     

☔ 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.

@github-actions
Copy link

github-actions bot commented Jan 31, 2026

✅ Pull request no significant performance differences ✅

Summary

New baseline 'pull_request' is WITHIN the 'main' baseline thresholds.

Full Benchmark Comparison

Comparing results between 'main' and 'pull_request'

Host 'e75487a21c54' with 4 'x86_64' processors with 15 GB memory, running:
#18~24.04.1-Ubuntu SMP Sat Jun 28 04:46:03 UTC 2025

HummingbirdBenchmarks

HTTP:Cookie:Decode metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 4 4 4 4 4 4 4 338
pull_request 4 4 4 4 4 4 4 334
Δ 0 0 0 0 0 0 0 -4
Improvement % 0 0 0 0 0 0 0 -4

HTTP:URI:Decode metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 1 1 1 1 1 1 1 3480
pull_request 1 1 1 1 1 1 1 3423
Δ 0 0 0 0 0 0 0 -57
Improvement % 0 0 0 0 0 0 0 -57

HTTP:URI:QueryParameters metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 7 7 7 7 7 7 7 865
pull_request 7 7 7 7 7 7 7 878
Δ 0 0 0 0 0 0 0 13
Improvement % 0 0 0 0 0 0 0 13

Router:Echo metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 768 768 768 768 768 768 768 1089
pull_request 768 768 768 768 768 768 768 1067
Δ 0 0 0 0 0 0 0 -22
Improvement % 0 0 0 0 0 0 0 -22

Router:GET metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 468 468 468 468 468 468 468 2840
pull_request 468 468 468 468 468 468 468 2859
Δ 0 0 0 0 0 0 0 19
Improvement % 0 0 0 0 0 0 0 19

Router:Middleware metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 373 373 373 373 373 373 373 2727
pull_request 373 373 373 373 373 373 373 2647
Δ 0 0 0 0 0 0 0 -80
Improvement % 0 0 0 0 0 0 0 -80

Router:PUT metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 1270 1270 1270 1270 1270 1270 1270 838
pull_request 1270 1270 1270 1270 1270 1270 1270 846
Δ 0 0 0 0 0 0 0 8
Improvement % 0 0 0 0 0 0 0 8

Router:Parameters metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 668 668 668 668 668 668 668 2398
pull_request 668 668 668 668 668 668 668 2413
Δ 0 0 0 0 0 0 0 15
Improvement % 0 0 0 0 0 0 0 15

RouterBuilder:Middleware metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 372 372 372 372 372 372 372 2741
pull_request 372 372 372 372 372 372 372 2756
Δ 0 0 0 0 0 0 0 15
Improvement % 0 0 0 0 0 0 0 15

TrieRouter:LongPaths metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 2 2 2 2 2 2 2 229
pull_request 2 2 2 2 2 2 2 232
Δ 0 0 0 0 0 0 0 3
Improvement % 0 0 0 0 0 0 0 3

TrieRouter:Parameters metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 7 7 7 7 7 7 7 189
pull_request 7 7 7 7 7 7 7 185
Δ 0 0 0 0 0 0 0 -4
Improvement % 0 0 0 0 0 0 0 -4

TrieRouter:Routing metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 2 2 2 2 2 2 2 241
pull_request 2 2 2 2 2 2 2 248
Δ 0 0 0 0 0 0 0 7
Improvement % 0 0 0 0 0 0 0 7

URLEncodedForm:Decode metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 29 29 29 29 29 29 29 54
pull_request 29 29 29 29 29 29 29 53
Δ 0 0 0 0 0 0 0 -1
Improvement % 0 0 0 0 0 0 0 -1

URLEncodedForm:Encode metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 24 24 24 24 24 24 24 213
pull_request 24 24 24 24 24 24 24 213
Δ 0 0 0 0 0 0 0 0
Improvement % 0 0 0 0 0 0 0 0

@adam-fowler adam-fowler enabled auto-merge (squash) February 2, 2026 14:37
@adam-fowler adam-fowler merged commit 12aed8f into main Feb 2, 2026
7 checks passed
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