Skip to content

chore: May 2026 batch#33

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

chore: May 2026 batch#33
henvic wants to merge 10 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

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: golang golang.org/x/tools is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: go.modgolang/golang.org/x/tools@v0.45.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore golang/golang.org/x/tools@v0.45.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

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