| 390 | } |
| 391 | |
| 392 | func handleMissingRequestParts(connType Type, r *http.Request) { |
| 393 | if connType == TypeHTTP { |
| 394 | // http library has no guarantees that we receive a filled URL. If not, then we fill it, as we reuse the request |
| 395 | // for proxying. For proxying they should not matter since we control the dialer on every egress proxied. |
| 396 | if len(r.URL.Scheme) == 0 { |
| 397 | r.URL.Scheme = "http" |
| 398 | } |
| 399 | if len(r.URL.Host) == 0 { |
| 400 | r.URL.Host = "localhost:8080" |
| 401 | } |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | func isControlStreamUpgrade(r *http.Request) bool { |
| 406 | return r.Header.Get(InternalUpgradeHeader) == ControlStreamUpgrade |