MCPcopy
hub / github.com/ory/kratos / RequestURL

Function RequestURL

x/http.go:56–72  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

54}
55
56func RequestURL(r *http.Request) *url.URL {
57 source := *r.URL
58 source.Host = cmp.Or(source.Host, r.Header.Get("X-Forwarded-Host"), r.Host)
59
60 if proto := r.Header.Get("X-Forwarded-Proto"); len(proto) > 0 {
61 source.Scheme = proto
62 }
63
64 if source.Scheme == "" {
65 source.Scheme = "https"
66 if r.TLS == nil {
67 source.Scheme = "http"
68 }
69 }
70
71 return &source
72}
73
74// SendFlowCompletedAsRedirectOrJSON should be used when a login, registration, ... flow has been completed successfully.
75// It will redirect the user to the provided URL if the request accepts HTML, or return a JSON response if the request is

Callers 15

SecureRedirectToFunction · 0.92
newTestFlowFunction · 0.92
NewFlowFunction · 0.92
TestRegistrationExecutorFunction · 0.92
NewFlowFunction · 0.92
TestVerificationExecutorFunction · 0.92
NewFlowFunction · 0.92
TestSettingsExecutorFunction · 0.92
updateSettingsFlowMethod · 0.92

Calls 1

GetMethod · 0.45

Tested by 8

newTestFlowFunction · 0.74
TestRegistrationExecutorFunction · 0.74
TestVerificationExecutorFunction · 0.74
TestSettingsExecutorFunction · 0.74
TestLoginExecutorFunction · 0.74
TestRecoveryExecutorFunction · 0.74
TestRequestURLFunction · 0.68