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

http2: remove redundant "\n" when display http2 data frame #754

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chilli13
Copy link
Contributor

No description provided.

@dosubot dosubot bot added the improve label Mar 27, 2025
@cfc4n
Copy link
Member

cfc4n commented Mar 28, 2025

Thanks, but I don't think this is a bug.

@chilli13
Copy link
Contributor Author

Thanks, but I don't think this is a bug.

When the caller analyzes the http2 payload, the frame length is taken up by the redundant "\n", which does not belong to the payload. Every other position has a single "\n", is there any special reason why there are two "\n" here? Thks

image

@cfc4n
Copy link
Member

cfc4n commented Apr 3, 2025

The output in text mode is the content parsed by the program, not the original payload.

For example, the parsing of the http2 header has already been converted from bytes to text.

Therefore, I believe that an extra \n is added here for better readability. The same implementation is also present in the header output.


text模式的输出结果,是经过程序解析后的内容,并不是原始负载。

比如对http2 header的解析,已经从字节流转为文本了。

所以,我认为这里多了一个\n是为了更好地阅读体验 。同样在 header输出的地方,也有一样的实现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants