We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在tea.go中 307所在行位置
requestURL := "" request.Domain = request.Headers["host"] requestURL = fmt.Sprintf("%s://%s%s", StringValue(request.Protocol), StringValue(request.Domain),StringValue(request.Pathname))
URL一般情况由 protocol + host + port + pathname组成,很明显以上代码缺少port端口号
The text was updated successfully, but these errors were encountered:
在python中 Tea/core.py中 第61-78行
host = request.headers.get('host') if not host: raise RequiredArgumentException('endpoint') else: host = host.rstrip('/') protocol = f'{request.protocol.lower()}://' pathname = request.pathname if host.startswith(('http://', 'https://')): protocol = '' if request.port == 80: port = '' else: port = f':{request.port}' url = protocol + host + port + pathname
但是在tea.go中 207-309 行
if request.Method == nil { request.Method = String("GET") } if request.Protocol == nil { request.Protocol = String("http") } else { request.Protocol = String(strings.ToLower(StringValue(request.Protocol))) } requestURL := "" request.Domain = request.Headers["host"] requestURL = fmt.Sprintf("%s://%s%s", StringValue(request.Protocol), StringValue(request.Domain), StringValue(request.Pathname))
很明显go中缺少对url的组装中缺少port端口号
修复建议
requestURL := "" request.Domain = request.Headers["host"] if request.Port == nil{ requestURL = fmt.Sprintf("%s://%s%s", StringValue(request.Protocol), StringValue(request.Domain), StringValue(request.Pathname)) }else { requestURL = fmt.Sprintf("%s://%s:%d%s", StringValue(request.Protocol), StringValue(request.Domain),IntValue(request.Port), StringValue(request.Pathname)) }
**请尽快修复,谢谢🙏🙏 @JacksonTian @denverdino @peze @jasonHzq **
Sorry, something went wrong.
No branches or pull requests
url组装缺少port
在tea.go中 307所在行位置
URL一般情况由 protocol + host + port + pathname组成,很明显以上代码缺少port端口号
The text was updated successfully, but these errors were encountered: