hyperium / hyperium/h2

Need Control over Header Indexing in HPack

Open
#214 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
1.6k
Forks
382
Avg merge
20h 23m
Merged PRs (30d)
9

Description

Presently, it seems that the Header/HPACK process in H2 is opaque. However, sometimes it is necessary to control how headers are indexed (or re-indexed) into the HPACK dictionary.
(e.g. https://tools.ietf.org/html/rfc7541#section-6.2.1 )

Specifically, I am writing a tool which pushes via Apple APN. It has requirements for some, but not all of its headers to be set differently, based on whether it is the first send of the request, or subsequent ones.

From Apple's docs : https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html

The :path value should be encoded as a literal header field without indexing

The authorization request header, if present, should be encoded as a literal header field without indexing

The appropriate encoding to employ for the apns-id, apns-expiration, and apns-collapse-id request headers differs depending on whether it is part of the initial or a subsequent POST operation, as follows:

The first time you send these headers, encode them with incremental indexing to allow the header names to be added to the dynamic table

Subsequent times you send these headers, encode them as literal header fields without indexing

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the HTTP/2 header and HPACK encoding entry points that currently make indexing opaque, then read the RFC 7541 section and the linked APNs requirements. Determine the API and scope needed to control indexing for individual headers, and verify that initial and subsequent encodings can be distinguished as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.