-
Notifications
You must be signed in to change notification settings - Fork 2.6k
HttpTask support auth when has userinfo #1554
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
Conversation
src/factory/HttpTaskImpl.cc
Outdated
|
|
||
| this->WFComplexClientTask::set_transport_type(is_ssl ? TT_TCP_SSL : TT_TCP); | ||
| client_req->set_request_uri(request_uri.c_str()); | ||
| client_req->set_header_pair("Host", header_host.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们希望Host永远是第一个header。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接把那段挪到这下面吧。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好像Proxy那里也是一样的问题。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
遇到重定向,好像没有清除这个Header。还有个问题,就是重定向失败,也需要清除。目前重定向失败是有清除Host的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种情况下清除header的目的是什么呢,这个header有可能是用户设置的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
重定向还不清除?重定向可能会有新的userinfo吧。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
遇到重定向,好像没有清除这个Header。还有个问题,就是重定向失败,也需要清除。目前重定向失败是有清除Host的。
两个问题
遇到重定向,好像没有清除这个Header
重定向需要清除这个header,同时应清除Cookie等其他敏感信息,分两种情况
- 同站重定向时,通常仍需这个认证,清除后只是会另用户困惑,不会有安全风险
- 跨站重定向时,需要清除以避免泄露信息
还有个问题,就是重定向失败,也需要清除
这种情况下清除header的目的是什么呢,这个header有可能是用户设置的
src/factory/HttpTaskImpl.cc
Outdated
| else | ||
| portb = strcasecmp(b.scheme, "http") == 0 ? 80 : 443; | ||
|
|
||
| return strcasecmp(a.scheme, b.scheme) == 0 && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要是地址不一样,端口不就白算了吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我感觉是不是咱们只要判断host部分相同就是可以了?如果一个站点从http redirect到https,是不是应该认为还是同一个站?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有道理,端口不参与域名解析,可以认为同一个host名表示同一个服务主体
* HttpTask support auth when has userinfo * remove one StringUtil::url_decode as requested in #1554
No description provided.