{"action":"opened","issue":{"url":"https://api.github.com/repos/netty/netty/issues/5228","repository_url":"https://api.github.com/repos/netty/netty","labels_url":"https://api.github.com/repos/netty/netty/issues/5228/labels{/name}","comments_url":"https://api.github.com/repos/netty/netty/issues/5228/comments","events_url":"https://api.github.com/repos/netty/netty/issues/5228/events","html_url":"https://github.com/netty/netty/issues/5228","id":153831295,"number":5228,"title":"AssertionError in Hpack Decoder","user":{"login":"carl-mastrangelo","id":8943572,"avatar_url":"https://avatars.githubusercontent.com/u/8943572?v=3","gravatar_id":"","url":"https://api.github.com/users/carl-mastrangelo","html_url":"https://github.com/carl-mastrangelo","followers_url":"https://api.github.com/users/carl-mastrangelo/followers","following_url":"https://api.github.com/users/carl-mastrangelo/following{/other_user}","gists_url":"https://api.github.com/users/carl-mastrangelo/gists{/gist_id}","starred_url":"https://api.github.com/users/carl-mastrangelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carl-mastrangelo/subscriptions","organizations_url":"https://api.github.com/users/carl-mastrangelo/orgs","repos_url":"https://api.github.com/users/carl-mastrangelo/repos","events_url":"https://api.github.com/users/carl-mastrangelo/events{/privacy}","received_events_url":"https://api.github.com/users/carl-mastrangelo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-09T17:48:34Z","updated_at":"2016-05-09T17:48:34Z","closed_at":null,"body":"```\r\nbyte[] input = {\r\n        19, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, -92, 91, 41, -92,\r\n        33, 1, 0, -126, -1, -1, 0, 15, 0, -92, 0, 0\r\n    };\r\nDecoder decoder = new Decoder(MAX_HEADER_SIZE, MAX_HEADER_TABLE_SIZE);\r\n      decoder.decode(new ByteArrayInputStream(input), listener);\r\n```\r\n\r\nThis causes an error to be thrown from:\r\n[Decoder](https://github.com/netty/netty/blob/4.1/codec-http2/src/main/java/io/netty/handler/codec/http2/internal/hpack/Decoder.java#L505)\r\n\r\n\r\nThe reason is because of the two 0xFF bytes in the input, which are interpretted as trailing padding in a huffman encoded value.  From reading the [spec](https://http2.github.io/http2-spec/compression.html#string.literal.representation), the last paragraph says that padding in excess of 7 bits is an error (rather than being ignored).\r\n\r\nThe problem here is that it should be an IOException instead of an Assert.\r\n\r\nFinally, I don't see anywhere in the Spec that says 0 length values are not allowed, so I don't know why they are forbidden.   Did I just miss somewhere?"}}