Skip to content

chore: May 2026 batch#33

Open
henvic wants to merge 12 commits into
mainfrom
chore/2026-may
Open

chore: May 2026 batch#33
henvic wants to merge 12 commits into
mainfrom
chore/2026-may

Conversation

@henvic
Copy link
Copy Markdown
Owner

@henvic henvic commented May 23, 2026

May 2026 maintenance batch.
The library supports the last two major Go releases whenever updated. Now: 1.25 and 1.26.

  • Color response status line by status class.
  • http.Flusher and http.ResponseController support in Middleware.
  • Print subjectAltName line in curl format on printCertificate.
  • Recognize application/gzip as a binary media type
    • Use tls.VersionName and tls.CipherSuiteName from the stdlib, deleting the hand-maintained tlsCiphers/tlsProtocolVersions tables in tls.go.

Fixes

  • isBinary was checking the wrong portion of the body — it sliced body[512:] (skipping the first 512 bytes) instead of body[:512], so the binary-detection heuristic looked at the wrong region.
  • printServerResponse Content-Type check now uses the response header (rec.Header()) instead of the request header (req.Header), so binary-response detection keys off the actual response Content-Type.
  • Typo fixes in comments and a test error message.

henvic added 8 commits May 3, 2026 14:46
body[512:] examined bytes *after* position 512 instead of the first
512 bytes. Binary detection (BOM check, control character scan, and
http.DetectContentType) operated on the tail of the body rather than
the head, which is what the MIME sniffing spec and DetectContentType
expect.

A body of length 513+ with a leading BOM was misclassified, since the
BOM check requires len(body) >= 3 against the start of the slice.
- Removes the locally maintained tls.go maps in favor of the standard library.
- tls.CipherSuiteName available since Go 1.14.
- tls.VersionName available since Go 1.21.
- Implements Unwrap() on responseRecorder to support http.ResponseController (Go 1.20+).
- Let handlers stream via direct w.(http.Flusher) assertions when the underlying writer supports it.
Previously, the response status line was always printed red.
Now httpretty picks the color depending on the HTTP status class:
2xx green, 3xx yellow, 4xx red, 5xx bold red, and blue for 1xx.
@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 23, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgolang.org/​x/​tools@​v0.14.0 ⏵ v0.45.075 +1100100100100

View full report

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 23, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@henvic henvic changed the title chore: May 2026 batch — TLS SAN output, status-class colors, Flusher/ResponseController, binary-detection fixes, Go 1.25/1.26 chore: May 2026 batch May 23, 2026
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.

1 participant