MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / RequestURL

Function RequestURL

pkg/webmiddleware/request_url.go:20–31  ·  view source on GitHub ↗

RequestURL populates (*http.Request).URL with the scheme and host.

()

Source from the content-addressed store, hash-verified

18
19// RequestURL populates (*http.Request).URL with the scheme and host.
20func RequestURL() MiddlewareFunc {
21 return func(next http.Handler) http.Handler {
22 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
23 r.URL.Host = r.Host
24 r.URL.Scheme = schemeHTTP
25 if r.TLS != nil {
26 r.URL.Scheme = schemeHTTPS
27 }
28 next.ServeHTTP(w, r)
29 })
30 }
31}

Callers 4

NewFunction · 0.92
NewServerFunction · 0.92
NewFunction · 0.92
TestRequestURLFunction · 0.85

Calls 1

ServeHTTPMethod · 0.45

Tested by 1

TestRequestURLFunction · 0.68