请求的服务器地址中的端口
()
| 1466 | |
| 1467 | // 请求的服务器地址中的端口 |
| 1468 | func (this *HTTPRequest) requestServerPort() int { |
| 1469 | if len(this.ServerAddr) > 0 { |
| 1470 | _, port, err := net.SplitHostPort(this.ServerAddr) |
| 1471 | if err == nil && len(port) > 0 { |
| 1472 | return types.Int(port) |
| 1473 | } |
| 1474 | } |
| 1475 | |
| 1476 | var host = this.RawReq.Host |
| 1477 | if len(host) > 0 { |
| 1478 | _, port, err := net.SplitHostPort(host) |
| 1479 | if err == nil && len(port) > 0 { |
| 1480 | return types.Int(port) |
| 1481 | } |
| 1482 | } |
| 1483 | |
| 1484 | if this.IsHTTP { |
| 1485 | return 80 |
| 1486 | } |
| 1487 | return 443 |
| 1488 | } |
| 1489 | |
| 1490 | func (this *HTTPRequest) Id() string { |
| 1491 | return this.requestId |
no outgoing calls
no test coverage detected