Skip to content

Conversation

@kedixa
Copy link
Contributor

@kedixa kedixa commented May 16, 2024

No description provided.


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());
Copy link
Contributor

Choose a reason for hiding this comment

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

我们希望Host永远是第一个header。

Copy link
Contributor

Choose a reason for hiding this comment

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

直接把那段挪到这下面吧。

Copy link
Contributor

Choose a reason for hiding this comment

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

好像Proxy那里也是一样的问题。

Copy link
Contributor

Choose a reason for hiding this comment

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

遇到重定向,好像没有清除这个Header。还有个问题,就是重定向失败,也需要清除。目前重定向失败是有清除Host的。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这种情况下清除header的目的是什么呢,这个header有可能是用户设置的

Copy link
Contributor

Choose a reason for hiding this comment

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

重定向还不清除?重定向可能会有新的userinfo吧。

Copy link
Contributor Author

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其他敏感信息,分两种情况

  1. 同站重定向时,通常仍需这个认证,清除后只是会另用户困惑,不会有安全风险
  2. 跨站重定向时,需要清除以避免泄露信息

还有个问题,就是重定向失败,也需要清除

这种情况下清除header的目的是什么呢,这个header有可能是用户设置的

else
portb = strcasecmp(b.scheme, "http") == 0 ? 80 : 443;

return strcasecmp(a.scheme, b.scheme) == 0 &&
Copy link
Contributor

Choose a reason for hiding this comment

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

要是地址不一样,端口不就白算了吗?

Copy link
Contributor

Choose a reason for hiding this comment

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

我感觉是不是咱们只要判断host部分相同就是可以了?如果一个站点从http redirect到https,是不是应该认为还是同一个站?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

有道理,端口不参与域名解析,可以认为同一个host名表示同一个服务主体

kedixa added a commit to kedixa/workflow that referenced this pull request May 28, 2024
@Barenboim Barenboim merged commit d54f06e into sogou:master May 28, 2024
Barenboim pushed a commit that referenced this pull request May 28, 2024
* HttpTask support auth when has userinfo

* remove one StringUtil::url_decode as requested in #1554
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants