hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: How to use HPACK with HttpClient 5
Date Thu, 23 Aug 2018 08:38:00 GMT
On Wed, 2018-08-22 at 16:57 +0200, Jack van Ooststroom wrote:
> Hello,
> We started using HttpClient 5 in order for us to communicate with 
> Apple's APNs service which requires the usage of HTTP/2. However, we
> are 
> currently running into an issue with the "apns-collapse-id" header. 
> According to the specification 
> (https://developer.apple.com/library/archive/documentation/Networking
> Internet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html)
> :
>     /"APNs requires the use of HPACK (header compression for HTTP/2),
>     which prevents repeated header keys and values. APNs maintains a
>     small dynamic table for HPACK. To help avoid filling up the APNs
>     HPACK table and necessitating the discarding of table data,
> encode
>     headers in the following way—especially when sending a large
> number
>     of streams:/
>       * /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:/
>           o /The first time you send these headers, encode them with
>             incremental indexing to allow the header names to be
> added
>             to the dynamic table/
>           o /Subsequent times you send these headers, encode them as
>             literal header fields without indexing/
>     /Encode all other headers as literal header fields with
> incremental
>     indexing. For specifics on header encoding, see
>     tools.ietf.org/html/rfc7541#section-6.2.1 and
>     tools.ietf.org/html/rfc7541#section-6.2.2."/
> When setting headers on a SimpleHttpRequest, how can we
> differentiate 
> between /"... //encode them with incremental indexing..."/ and /"... 
> //encode them as literal header fields without indexing"/?

Use `sensitive` attribute on the request header to ensure its literal
encoding of the header when transmitted over an HTTP/2 connection.


To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message