Skip to content

HTTP/1.1 302 Moved Temporarily头部解析错误 #5

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

Closed
XunChangqing opened this issue Jul 24, 2015 · 3 comments
Closed

HTTP/1.1 302 Moved Temporarily头部解析错误 #5

XunChangqing opened this issue Jul 24, 2015 · 3 comments
Assignees
Labels

Comments

@XunChangqing
Copy link

http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1&ch=0&di=8&fv=11&is_app=0&jk=c51b868e7e5aedc7&k=%CB%E9%B6%A4%D7%E3%C7%F2%D0%AC&k0=%CB%E9%B6%A4%D7%E3%C7%F2%D0%AC&k1=%D7%E3%C7%F2%D0%AC&k2=%D4%F3%CE%F5%CD%B6%D7%CA&k3=%B1%A3%CF%D5%B9%AB%CB%BE%C5%C5%C3%FB&kdi0=8&kdi1=8&kdi2=8&kdi3=8&luki=1&n=10&p=baidu&q=linyufeng_cpr&rb=0&rs=1&seller_id=1&sid=c7ed5a7e8e861bc5&ssp2=1&stid=8&t=tpclicked3_hc&td=1091111&tu=u1091111&u=http%3A%2F%2Fwww%2Ezhibo8%2Ecc%2Fzuqiu%2F2015%2F0724%2Dhuangma%2Djijin%2Ehtm&urlid=0
访问这种网页,状态为302 redirect时,头部解析会报错
status 302 redirect:
这个域的名字里面包含空格
case parse_header_state::header_field_name:
if (is_token_char(_iter) || *iter == ' ') {
header_field_name.push_back(_iter);
}
我在判断域名字的时候增加了空格的可能,这样可以正常访问,但是这样会导致将冒号前的空格都当做域名字,我在得到域名字以后再把后面的空格删掉,不知道这样还会不会有其他潜在问题。

@XunChangqing
Copy link
Author

status 302 redirect:
这个域的名字里面包含空格

@lxrite
Copy link
Owner

lxrite commented Jul 25, 2015

感谢反馈,之前看RFC的时候似乎并不允许头域的名字中有空格。不过测试了下Chrome确实接受了status 302 redirect:这样的响应头。

我在判断域名字的时候增加了空格的可能,这样可以正常访问,但是这样会导致将冒号前的空格都当做域名字,我在得到域名字以后再把后面的空格删掉,不知道这样还会不会有其他潜在问题。

这样做不会有其他潜在问题。

@lxrite lxrite added the bug label Jul 25, 2015
@lxrite lxrite self-assigned this Jul 25, 2015
@lxrite
Copy link
Owner

lxrite commented Jul 26, 2015

已修复。

@lxrite lxrite closed this as completed Jul 26, 2015
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