| 297 | } |
| 298 | |
| 299 | void URI::Print(std::ostream& os) const { |
| 300 | if (!_host.empty()) { |
| 301 | if (!_scheme.empty()) { |
| 302 | os << _scheme << "://"; |
| 303 | } else { |
| 304 | os << "http://"; |
| 305 | } |
| 306 | // user_info is passed by Authorization |
| 307 | os << _host; |
| 308 | if (_port >= 0) { |
| 309 | os << ':' << _port; |
| 310 | } |
| 311 | } |
| 312 | PrintWithoutHost(os); |
| 313 | } |
| 314 | |
| 315 | void URI::PrintWithoutHost(std::ostream& os) const { |
| 316 | if (_path.empty()) { |