Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SETTINGS_HEADER_TABLE_SIZE not respected #27

Closed
pcapriotti opened this issue Jun 8, 2021 · 0 comments · Fixed by #28
Closed

SETTINGS_HEADER_TABLE_SIZE not respected #27

pcapriotti opened this issue Jun 8, 2021 · 0 comments · Fixed by #28

Comments

@pcapriotti
Copy link
Contributor

It seems that http2 servers fail to respect the table size settings sent by the client. This issue manifested for us as a 502 error from an nginx ingress controller in kubernetes, sitting in front of a grpc server written with mu-grpc-server.

To reproduce, I used the example server in the http2 library code:

{-# LANGUAGE OverloadedStrings #-}

module Main where

import qualified Control.Exception as E
import Data.ByteString.Builder (byteString)
import Network.HTTP.Types (ok200)
import Network.HTTP2.Server
import Network.Run.TCP (runTCPServer)

main :: IO ()
main = runTCPServer Nothing "50051" runHTTP2Server
  where
    runHTTP2Server s =
      E.bracket
        (allocSimpleConfig s 4096)
        freeSimpleConfig
        (\config -> run config server)
    server _req _aux sendResponse = sendResponse response []
      where
        response = responseBuilder ok200 header body
        header =
          [("Content-Type", "text/plain")]
        body = byteString "Hello, world!\n"

and fed it this sequence of two requests. The requests contain GRPC invokations, but that is not relevant. There is a SETTINGS_HEADER_TABLE_SIZE frame with value 0 in the beginning, but the response I get for the second request has the following header fragment:

20 88 be

And be decodes to index 62, which is outside the static range (presumably, it is referring to the previously sent content-type header).

This is a wireshark dump of the interaction.

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 a pull request may close this issue.

1 participant