Skip to content

feature: Support for auto parsing http gzip response content #260 #301

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

Open
wants to merge 5 commits into
base: feature/1.6.0
Choose a base branch
from

Conversation

haolipeng
Copy link
Contributor

feature: Support for auto parsing http gzip response content #260

Copy link

vercel bot commented Mar 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kyanos ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 13, 2025 1:34am

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Mar 9, 2025
@hengyoush hengyoush changed the base branch from main to feature/1.6.0 March 13, 2025 11:36

// 创建gzip.Reader
gzipReader, err := gzip.NewReader(bytesReader)
if err != nil {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resp.buf contains the response headers, so you CAN NOT gzip decompress the entire resp.buf as this will fail. Hint: If you debug to this point, you'll find that err is not nil.

}
defer gzipReader.Close()

// 读取解压后的内容
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls use English

import time
import sys

# 创建一个Session对象
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls use English.


cat "${NGINX_GZIP_TEST_LNAME}"
# 检查是否包含 gzip 相关信息
check_patterns_in_file "${NGINX_GZIP_TEST_LNAME}" "Content-Encoding: gzip"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should verify the response body but not the header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants