Skip to content

Commit 72595ad

Browse files
committed
fix: use full URL for webhook payload
1 parent 66a9448 commit 72595ad

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

selfservice/hook/web_hook.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type (
4545
Flow flow.Flow `json:"flow"`
4646
RequestHeaders http.Header `json:"request_headers"`
4747
RequestMethod string `json:"request_method"`
48-
RequestUrl string `json:"request_url"`
48+
RequestURL string `json:"request_url"`
4949
Identity *identity.Identity `json:"identity,omitempty"`
5050
}
5151

@@ -81,7 +81,7 @@ func (e *WebHook) ExecuteLoginPreHook(_ http.ResponseWriter, req *http.Request,
8181
Flow: flow,
8282
RequestHeaders: req.Header,
8383
RequestMethod: req.Method,
84-
RequestUrl: req.RequestURI,
84+
RequestURL: x.RequestURL(req).String(),
8585
})
8686
}
8787

@@ -91,7 +91,7 @@ func (e *WebHook) ExecuteLoginPostHook(_ http.ResponseWriter, req *http.Request,
9191
Flow: flow,
9292
RequestHeaders: req.Header,
9393
RequestMethod: req.Method,
94-
RequestUrl: req.RequestURI,
94+
RequestURL: x.RequestURL(req).String(),
9595
Identity: session.Identity,
9696
})
9797
}
@@ -102,7 +102,7 @@ func (e *WebHook) ExecutePostVerificationHook(_ http.ResponseWriter, req *http.R
102102
Flow: flow,
103103
RequestHeaders: req.Header,
104104
RequestMethod: req.Method,
105-
RequestUrl: req.RequestURI,
105+
RequestURL: x.RequestURL(req).String(),
106106
Identity: id,
107107
})
108108
}
@@ -113,7 +113,7 @@ func (e *WebHook) ExecutePostRecoveryHook(_ http.ResponseWriter, req *http.Reque
113113
Flow: flow,
114114
RequestHeaders: req.Header,
115115
RequestMethod: req.Method,
116-
RequestUrl: req.RequestURI,
116+
RequestURL: x.RequestURL(req).String(),
117117
Identity: session.Identity,
118118
})
119119
}
@@ -124,7 +124,7 @@ func (e *WebHook) ExecuteRegistrationPreHook(_ http.ResponseWriter, req *http.Re
124124
Flow: flow,
125125
RequestHeaders: req.Header,
126126
RequestMethod: req.Method,
127-
RequestUrl: req.RequestURI,
127+
RequestURL: x.RequestURL(req).String(),
128128
})
129129
}
130130

@@ -134,7 +134,7 @@ func (e *WebHook) ExecutePostRegistrationPrePersistHook(_ http.ResponseWriter, r
134134
Flow: flow,
135135
RequestHeaders: req.Header,
136136
RequestMethod: req.Method,
137-
RequestUrl: req.RequestURI,
137+
RequestURL: x.RequestURL(req).String(),
138138
Identity: id,
139139
})
140140
}
@@ -145,7 +145,7 @@ func (e *WebHook) ExecutePostRegistrationPostPersistHook(_ http.ResponseWriter,
145145
Flow: flow,
146146
RequestHeaders: req.Header,
147147
RequestMethod: req.Method,
148-
RequestUrl: req.RequestURI,
148+
RequestURL: x.RequestURL(req).String(),
149149
Identity: session.Identity,
150150
})
151151
}
@@ -156,7 +156,7 @@ func (e *WebHook) ExecuteSettingsPostPersistHook(_ http.ResponseWriter, req *htt
156156
Flow: flow,
157157
RequestHeaders: req.Header,
158158
RequestMethod: req.Method,
159-
RequestUrl: req.RequestURI,
159+
RequestURL: x.RequestURL(req).String(),
160160
Identity: id,
161161
})
162162
}
@@ -165,7 +165,7 @@ func (e *WebHook) execute(ctx context.Context, data *templateContext) error {
165165
span := trace.SpanFromContext(ctx)
166166
attrs := map[string]string{
167167
"webhook.http.method": data.RequestMethod,
168-
"webhook.http.url": data.RequestUrl,
168+
"webhook.http.url": data.RequestURL,
169169
"webhook.http.headers": fmt.Sprintf("%#v", data.RequestHeaders),
170170
}
171171

0 commit comments

Comments
 (0)