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

Accept-Encoding 判断错误 #2988

Closed
apetab opened this issue Nov 29, 2019 · 5 comments
Closed

Accept-Encoding 判断错误 #2988

apetab opened this issue Nov 29, 2019 · 5 comments
Labels

Comments

@apetab
Copy link

apetab commented Nov 29, 2019

http请求头:

Accept-Encoding: gzip, deflate
Accept: */*

gzip判断出错:出错位置

@twose
Copy link
Member

twose commented Nov 29, 2019

?

@twose twose closed this as completed Nov 29, 2019
@apetab
Copy link
Author

apetab commented Nov 29, 2019

这个请求时应该识别成: accept_compression=1, 可是最后识别成了:accept_compression=0, 因为Accept: */* 也通过了判断条件, 进入了:swoole_http_get_compression_method

apetab added a commit to apetab/swoole-src that referenced this issue Nov 29, 2019
@twose
Copy link
Member

twose commented Nov 29, 2019

还是没懂你在说什么 补丁也没看懂

@apetab
Copy link
Author

apetab commented Nov 29, 2019

用程序解释吧:

header_len = 15
header_name = "accept-encoding"
if (strncmp(header_name, "accept-encoding", header_len) == 0) {
    // passs
}
header_len = 6
header_name = "accept"
if (strncmp(header_name, "accept-encoding", header_len) == 0) {
    // passs
}

apetab added a commit to apetab/swoole-src that referenced this issue Nov 29, 2019
@twose
Copy link
Member

twose commented Nov 29, 2019

抱歉,现在看明白了,这个问题需要一个彻底的修复(不仅仅是Accept)

@twose twose reopened this Nov 29, 2019
@twose twose added the bug label Nov 29, 2019
twose added a commit that referenced this issue Nov 29, 2019
matyhtf added a commit that referenced this issue Nov 29, 2019
@apetab apetab closed this as completed Nov 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants