Dynamic table reverse lookup search
- Dominant language
- JavaScript
- Stars
- 41
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
I was looking and this implementation and I have question regarding dynamic table specifically how [reverse lookup](https://github.com/indutny/hpack.js/blob/c23a03a4ef7fed112e57998911d7ae8df8925616/lib/hpack/table.js#L31) works.
If I understand this correctly It first searches static table then goes to the dynamic table where it first checks if name + value are the same if that is not so it checks if only name is the same and if it is and it is not in the static table it returns this value.
But lets say for example that we have a dynamic table like this:
```
1. "custom-name": "custom-value-1"
2. ":status": "202"
3. "custom-name": "custom-value-2"
```
And you are encoding header`"custom-name": "custom-value-2"`. In this case since header `"custom-name"` in not in the static table and because header `"custom-name": "custom-value-1"` is on the top of dynamic table the encoder will take index 1 and do literal encoding for value instead of using direct match of both name and value at index 3.
Is my understanding of this correct? And if so is this a bug?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at lib/hpack/table.js line 31 and trace reverse lookup for the supplied dynamic-table ordering. Compare the result with the HPACK indexing rules and determine whether the encoder should prefer the exact match at index 3; done means documenting whether this is expected behavior or a bug, with a focused test if a behavior change is warranted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100