MCPcopy
hub / github.com/cloudflare/cloudflared / handleMissingRequestParts

Function handleMissingRequestParts

connection/http2.go:392–403  ·  view source on GitHub ↗
(connType Type, r *http.Request)

Source from the content-addressed store, hash-verified

390}
391
392func 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
405func isControlStreamUpgrade(r *http.Request) bool {
406 return r.Header.Get(InternalUpgradeHeader) == ControlStreamUpgrade

Callers 1

ServeHTTPMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected