Store and show an event's query string, and pass it on to an HTTP target when set (closes #312)
check / check (push) Successful in 6m32s
check / check (push) Successful in 6m32s
The receiver keeps the query string of the request it received on the event, in a new `raw_query` column of the per-webhook `events` table; a resubmitted copy carries its original's. The event log and the event's page show it with the request, the event log leaving out one over 32 KiB as it does request headers. The archive and log targets carry it. An HTTP target gets a `forwardQuery` setting, off by default, on both target forms and in the target list: on, each delivery, replays and resubmits included, appends the query string to the target URL, joined with `&` to one it already has. Model: opus-5-5
This commit is contained in:
@@ -1,15 +1,23 @@
|
||||
{{define "event_request"}}
|
||||
<!-- The entrypoint an event arrived at and its request headers, as
|
||||
handlers.EventLogView carries them: the same in the event log and
|
||||
the event's own page. The entrypoint's URL is never shown. A
|
||||
resubmitted copy, even a copy of a copy, did not arrive at an
|
||||
entrypoint; the request it copies did. -->
|
||||
<!-- The entrypoint an event arrived at, its query string and its
|
||||
request headers, as handlers.EventLogView carries them: the same in
|
||||
the event log and the event's own page. The entrypoint's URL is
|
||||
never shown. A resubmitted copy, even a copy of a copy, did not
|
||||
arrive at an entrypoint; the request it copies did. -->
|
||||
<div class="space-y-2 text-xs">
|
||||
{{if .ResubmittedFrom}}
|
||||
<p class="text-gray-500">The request it copies arrived at <span class="text-gray-900 wrap-anywhere">{{.Entrypoint}}</span></p>
|
||||
{{else}}
|
||||
<p class="text-gray-500">Arrived at <span class="text-gray-900 wrap-anywhere">{{.Entrypoint}}</span></p>
|
||||
{{end}}
|
||||
{{if .RawQueryCut}}
|
||||
<p class="text-gray-500">The query string is larger than the event log shows. <a href="{{.Body.EventURL}}" class="btn-small">Show the query string</a></p>
|
||||
{{else if .RawQuery}}
|
||||
<p class="text-gray-500">Query string</p>
|
||||
<pre class="rounded-md border border-gray-200 bg-white p-2 text-xs text-gray-700 overflow-x-auto whitespace-pre-wrap break-all">{{.RawQuery}}</pre>
|
||||
{{else}}
|
||||
<p class="text-gray-500">No query string.</p>
|
||||
{{end}}
|
||||
{{if .HeadersCut}}
|
||||
<p class="text-gray-500">The request headers are larger than the event log shows. <a href="{{.Body.EventURL}}" class="btn-small">Show the request headers</a></p>
|
||||
{{else if .Headers}}
|
||||
|
||||
@@ -135,6 +135,7 @@
|
||||
data-destination="{{.TargetForm.URL}}"
|
||||
data-headers="{{.TargetForm.Headers}}"
|
||||
data-timeout="{{.TargetForm.Timeout}}"
|
||||
{{if .TargetForm.ForwardQuery}}data-forward-query{{end}}
|
||||
data-max-retries="{{.TargetForm.MaxRetries}}"
|
||||
data-expiry="{{.TargetForm.Expiry}}"
|
||||
data-rotation="{{.TargetForm.Rotation}}">
|
||||
@@ -183,6 +184,13 @@
|
||||
<label class="text-sm text-gray-700">Timeout (seconds, blank = default):</label>
|
||||
<input type="number" name="timeout" :value="timeout" min="0" max="300" class="input text-sm w-24">
|
||||
</div>
|
||||
<div>
|
||||
<label class="flex items-center gap-2 text-sm text-gray-700">
|
||||
<input type="checkbox" name="forward_query" value="on" :checked="forwardQuery" class="h-4 w-4">
|
||||
Pass the query string on to this target
|
||||
</label>
|
||||
<p class="text-xs text-gray-500 mt-1">Appends the query string each event arrived with to the URL above, after any query string the URL already has.</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex gap-2 items-center">
|
||||
<label class="text-sm text-gray-700">Delivery attempts:</label>
|
||||
|
||||
@@ -47,6 +47,14 @@
|
||||
<input type="number" id="timeout" name="timeout" value="{{.TargetForm.Timeout}}" min="0" max="{{.MaxTimeout}}" class="input">
|
||||
<p class="text-xs text-gray-500 mt-1">Per-request timeout, at most {{.MaxTimeout}} seconds. Leave blank to use the default.</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="flex items-center gap-2 text-sm font-medium text-gray-700">
|
||||
<input type="checkbox" id="forward_query" name="forward_query" value="on"{{if .TargetForm.ForwardQuery}} checked{{end}} class="h-4 w-4">
|
||||
Pass the query string on to this target
|
||||
</label>
|
||||
<p class="text-xs text-gray-500 mt-1">Appends the query string each event arrived with to the destination URL, after any query string the URL already has.</p>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if eq .Target.Type "slack"}}
|
||||
|
||||
Reference in New Issue
Block a user