Skip to content

fix(handler): adapt to api-go beta.5 HttpHeaderValue.values string type#245

Merged
rustatian merged 1 commit into
masterfrom
fix-api-go-beta-5-string-headers
May 10, 2026
Merged

fix(handler): adapt to api-go beta.5 HttpHeaderValue.values string type#245
rustatian merged 1 commit into
masterfrom
fix-api-go-beta-5-string-headers

Conversation

@rustatian
Copy link
Copy Markdown
Member

Summary

api v6.0.0-beta.2 and api-go v6.0.0-beta.5 changed HttpHeaderValue.values from `repeated bytes` to `repeated string`. The http plugin's handler still uses `[]byte(...)` / `string(...)` casts that worked against the old proto but no longer compile against beta.5 (and trigger `unconvert` on the reverse-direction casts). This PR drops the now-incorrect casts so the plugin compiles against the new api-go.

Affected sites:

  • `handler/convert.go`: drop `[]byte(...)` on append; collapse the inner loop in `convert()` into a variadic append; use `v` directly in `convertCookies()`.
  • `handler/response.go`: drop `string(...)` on `pusher.Push`, on the trailer `SplitSeq` input, and on the per-value `Header.Add` — all three were bytes→string conversions under the old proto and are no-ops now.

Bumps `api-go/v6 v6.0.0-beta.4 → v6.0.0-beta.5` in the root module. `tests/` submodule unchanged (still on beta.4; tests-side migration tracked separately when http tests migrate to Connect-RPC).

This unblocks the status plugin's Connect-RPC migration, which transitively pulls http/v6 through its tests submodule.

api-go v6.0.0-beta.5 changed HttpHeaderValue.values from `repeated bytes`
to `repeated string` (api commit 265bb1e). Update the http plugin's
handler package to drop the now-incorrect []byte()/string() casts and
take the protobuf field as a Go string slice directly.

Affected sites:
- convert.go: drop []byte(...) on append; collapse the inner loop into a
  variadic append in convert(); use v directly in convertCookies().
- response.go: drop string(...) on Push, on the trailer SplitSeq input,
  and on the per-value Header.Add — all three were converting from bytes
  to string under the old proto and are no-ops now.

Bumps api-go v6.0.0-beta.4 → v6.0.0-beta.5 in the root module. tests/
submodule unchanged (still on beta.4 alongside the rest of the test
toolchain; tests-side migration tracked separately).
Copilot AI review requested due to automatic review settings May 10, 2026 15:03
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

Warning

Rate limit exceeded

@rustatian has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 42 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 96fa9feb-1570-469d-899d-9ecf08c1c2fa

📥 Commits

Reviewing files that changed from the base of the PR and between 2ed0308 and 7d6bdd2.

⛔ Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • go.work.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • go.mod
  • handler/convert.go
  • handler/response.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-api-go-beta-5-string-headers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rustatian rustatian self-assigned this May 10, 2026
@rustatian rustatian added the enhancement New feature or request label May 10, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the HTTP plugin handler code to compile against github.com/roadrunner-server/api-go/v6 v6.0.0-beta.5, which changed HttpHeaderValue.values from repeated bytes to repeated string, by removing now-invalid byte/string casts.

Changes:

  • Remove obsolete []byte(...)/string(...) conversions when reading/writing proto header values.
  • Simplify header conversion logic using variadic append for header value slices.
  • Bump api-go/v6 dependency from v6.0.0-beta.4 to v6.0.0-beta.5 and update sums.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
handler/response.go Drops no-op casts when pushing HTTP/2 resources, writing headers, and splitting trailer header values.
handler/convert.go Adapts header/cookie conversion to append []string values directly into proto fields.
go.mod Bumps github.com/roadrunner-server/api-go/v6 to v6.0.0-beta.5.
go.sum Updates checksums for api-go/v6 version bump.
go.work.sum Updates workspace sums after dependency resolution changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rustatian rustatian merged commit 60ab5b2 into master May 10, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants