fix(http2): translate the Host request header to :authority #11627

Merged
edubox merged 1 commit from upstream-pr/11627 into main 2026-11-02 12:26:11 +00:00
edubox commented 2026-10-26 23:41:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-10-26T23:41:41Z.


What

sceHttp2AddRequestHeader refused a Host header as an HTTP/2 control header. Palworld (PPSA23126) sets Host: gaming-sdk.com on a request and stopped there. HTTP/2 carries the authority in :authority, and RFC 9113 section 8.3.1 says an HTTP/1.1 Host header is translated to :authority. This stores the header, uses its last value as the request's :authority, and keeps it out of the wire header list. The other control headers still throw, and a Host value with whitespace is rejected.

Tested

Linux (CachyOS), GCC 16.2.1, Release. guest_http2_transport runs against the loopback HTTP/2 server and covers a Host inherited from the template and overridden on the request with different case, then checks that the server sees one :authority with the request value and no Host field. Reverting the transport change makes that test fail at the missing :authority; restoring it passes. guest_http2, guest_http2_cookies and guest_http2_early_response still pass. Palworld PPSA23126 advances from the control-header refusal to sceHttp2SendRequestAsync; that export remains unimplemented.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5026316705 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11627). Originally posted by [edubox](https://github.com/edubox) on 2026-10-26T23:41:41Z. --- ### What `sceHttp2AddRequestHeader` refused a `Host` header as an HTTP/2 control header. Palworld (PPSA23126) sets `Host: gaming-sdk.com` on a request and stopped there. HTTP/2 carries the authority in `:authority`, and RFC 9113 section 8.3.1 says an HTTP/1.1 `Host` header is translated to `:authority`. This stores the header, uses its last value as the request's `:authority`, and keeps it out of the wire header list. The other control headers still throw, and a `Host` value with whitespace is rejected. ### Tested Linux (CachyOS), GCC 16.2.1, Release. `guest_http2_transport` runs against the loopback HTTP/2 server and covers a `Host` inherited from the template and overridden on the request with different case, then checks that the server sees one `:authority` with the request value and no `Host` field. Reverting the transport change makes that test fail at the missing `:authority`; restoring it passes. `guest_http2`, `guest_http2_cookies` and `guest_http2_early_response` still pass. Palworld PPSA23126 advances from the control-header refusal to `sceHttp2SendRequestAsync`; that export remains unimplemented. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-26 23:43:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T23:43:53Z.

Review: APPROVED


Reviewed exact head eb9aa573a85a26502d94244a42d629384d0e1cbb. The request builder selects the last configured Host value as :authority and omits Host from the HTTP/2 field list, consistent with RFC 9113 §8.3.1; other forbidden connection/control headers remain rejected. The test exercises template plus request-level override with case variation and verifies the loopback server receives one :authority and no host. The author reports the focused transport and HTTP/2 tests pass and the game advances to the next unimplemented export. Hosted conventions, eligibility, intake, labels and report pass; product/relinker checks are skipped by path policy. I did not independently rerun the local loopback suite. No blocking issue found.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5660573468 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11627#pullrequestreview-5660573468). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T23:43:53Z. **Review:** APPROVED --- Reviewed exact head `eb9aa573a85a26502d94244a42d629384d0e1cbb`. The request builder selects the last configured Host value as `:authority` and omits Host from the HTTP/2 field list, consistent with RFC 9113 §8.3.1; other forbidden connection/control headers remain rejected. The test exercises template plus request-level override with case variation and verifies the loopback server receives one `:authority` and no `host`. The author reports the focused transport and HTTP/2 tests pass and the game advances to the next unimplemented export. Hosted conventions, eligibility, intake, labels and report pass; product/relinker checks are skipped by path policy. I did not independently rerun the local loopback suite. No blocking issue found.
karimibrahim07 commented 2026-10-29 04:28:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by karimibrahim07 on 2026-10-29T04:28:17Z.

Review: COMMENTED


Windows run with a negative control, at head eb9aa573a8 merged onto main b433c40f2f with nothing else applied.

Windows 11 Pro 26300, Ryzen 5 3600, WinLibs GCC 15.2 (UCRT), Release, Ninja.

  • guest_http2 and guest_http2_transport pass 3 of 3 (--repeat until-fail:3). The verbose log shows HTTP2 host header scenario running before HTTP2 loopback transport passed, so HostAuthority is reached on Windows.
  • Negative control: Transport.cpp from main, the PR's test kept. guest_http2_transport aborts at that scenario with sceHttp2AddRequestHeader: unsupported HTTP/2 control header not implemented, the Palworld stop from #12109.

Read through the diff: a request Host set with mode 0 replaces the template's, since the erase works on the lowercased key, and the test covers that with mixed case. TLS still connects to the URL's host; only :authority changes. The debt entry records that a Host differing from the URL authority isn't measured. Nothing to change from my side.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692858853 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11627#pullrequestreview-5692858853). Originally posted by [karimibrahim07](https://github.com/karimibrahim07) on 2026-10-29T04:28:17Z. **Review:** COMMENTED --- Windows run with a negative control, at head `eb9aa573a8` merged onto `main` `b433c40f2f` with nothing else applied. Windows 11 Pro 26300, Ryzen 5 3600, WinLibs GCC 15.2 (UCRT), Release, Ninja. - `guest_http2` and `guest_http2_transport` pass 3 of 3 (`--repeat until-fail:3`). The verbose log shows `HTTP2 host header scenario` running before `HTTP2 loopback transport passed`, so `HostAuthority` is reached on Windows. - Negative control: `Transport.cpp` from `main`, the PR's test kept. `guest_http2_transport` aborts at that scenario with `sceHttp2AddRequestHeader: unsupported HTTP/2 control header not implemented`, the Palworld stop from #12109. Read through the diff: a request `Host` set with mode 0 replaces the template's, since the erase works on the lowercased key, and the test covers that with mixed case. TLS still connects to the URL's host; only `:authority` changes. The debt entry records that a `Host` differing from the URL authority isn't measured. Nothing to change from my side. AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!11627
No description provided.