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

无法以 HTTP 方式监听 80 端口 #542

Closed
KanakoMikami opened this issue Jul 23, 2023 · 1 comment
Closed

无法以 HTTP 方式监听 80 端口 #542

KanakoMikami opened this issue Jul 23, 2023 · 1 comment

Comments

@KanakoMikami
Copy link

GURL 在处理 HTTP URL 的时候,即使显式指定端口为 80,也会被当成默认端口去掉。

if (!url.port().empty()) {
if (!base::StringToInt(url.port(), &params->listen_port)) {
std::cerr << "Invalid port in --listen" << std::endl;
return false;
}
if (params->listen_port <= 0 ||
params->listen_port > std::numeric_limits<uint16_t>::max()) {
std::cerr << "Invalid port in --listen" << std::endl;
return false;
}
}

此时这里的 url.port() 为空串,导致默认的 8080 端口被保留。

@klzgrad
Copy link
Owner

klzgrad commented Aug 6, 2023

@klzgrad klzgrad closed this as completed Aug 6, 2023
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

No branches or pull requests

2 participants