Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #36910 - Expect ERB in URL for test webhook #68

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/webhook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def deliver(event_name:, payload:)
def test(payload: nil)
ForemanWebhooks::WebhookService.new(
webhook: self,
headers: rendered_headers(event, {}),
url: rendered_targed_url(event, {}),
headers: http_headers,
url: target_url,
event_name: event,
payload: test_payload(payload || '')
).execute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,16 @@ const WebhookTestModal = ({ toTest }) => {
enforceFocus
className="webhooks-modal"
>
<p>
{sprintf(
__(
'You are about to test %s webhook.' +
'\n' +
'Please, note that this will not contain actual information or render the attached template.' +
'\n' +
'You can specify below a custom payload to test the webhook with.'
),
name
)}
</p>
{`${sprintf(__('You are about to test %s webhook.'), name)} `}
{`${__(
'Please, note that this will not contain actual information or render the attached template.'
)} `}
{`${__(
'In case you are using dynamic URL (ERB template), this will not be rendered correctly due to the absence of a real object.'
)} `}
{__('You can specify below a custom payload to test the webhook with.')}
<br />
<br />
<ForemanForm
onSubmit={handleSubmit}
initialValues={initialTestValues}
Expand Down
Loading