Git Product home page Git Product logo

hpack-test-case's Introduction

hpack-test-case

Spec

HPACK: Header Compression for HTTP/2 https://tools.ietf.org/html/rfc7541

Directory

The raw-data directory has original stories of header data in json.

Other than raw-data directory, the HPACK implementations have their own directories to store the result of its encoder.

You can perform interoperability testing for your implementation with them.

File Name

Each json in story-#{n}.json is story case and shares compression context. Each story is either series of requests or responses.

JSON Format

Each json has:

  • description: general description of encoding strategy or implementation.
  • cases: array of test cases.
    • seqno: a sequence number. 0 origin.
    • header_table_size: the header table size sent in SETTINGS_HEADER_TABLE_SIZE and ACKed just before this case. The first case should contain this field. If omitted, the default value, 4,096, is used.
    • wire: encoded wire data in hex string.
    • headers: decoded http header in hash.

To test the decoder implementation, for each story file, for each case in cases in the order they appear, decode compressed header block in wire and verify the result against the header set in headers. Please note that elements in cases share the same compression context.

To test the encoder implementation, generate json story files by encoding header sets in headers. Using json files in raw-data is handy. Then use your decoder to verify that it can successfully decode the compressed header block. If you can play with other HPACK decoder implementations, try decoding your encoded data with them. If there is any mismatch, then there must be a bug in somewhere either encoder or decoder, or both.

{
  "description": "Encoded request headers with Literal without index only.",
  "cases": [
    {
      "seqno": 0,
      "header_table_size": 4096,
      "wire": "1234567890abcdef",
      "headers": [
        { ":method": "GET" },
        { ":scheme": "http" },
        { ":authority": "example.com" },
        { ":path": "/" },
        { "x-my-header": "value1,value2" }
      ]
    },
    .....
  ]
}

Original Data

These Header Data are converted from https://github.com/http2/http_samples

Compression Ratio

https://github.com/http2jp/hpack-test-case/wiki/Compression-Ratio

Contributor

  • jxck
  • summerwind
  • kazu-yamamoto
  • tatsuhiro-t

License

The MIT License (MIT)

hpack-test-case's People

Contributors

summerwind avatar jxck avatar kazu-yamamoto avatar tatsuhiro-t avatar lukasa avatar alanquatermain avatar flano-yuki avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.