Skip to content

Allow internal webhook call on the HTTP action on local dev environment#2213

Merged
MarceloRGonc merged 7 commits intomainfrom
mg/fix
Apr 10, 2026
Merged

Allow internal webhook call on the HTTP action on local dev environment#2213
MarceloRGonc merged 7 commits intomainfrom
mg/fix

Conversation

@MarceloRGonc
Copy link
Copy Markdown
Contributor

Fixes OPS-4101

@linear
Copy link
Copy Markdown

linear Bot commented Apr 9, 2026

Copilot AI review requested due to automatic review settings April 9, 2026 19:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the HTTP block’s webhook URL validation/rewriting logic so that, when a user provides a “public” webhook sync URL that fails internal-host validation (common in local dev), it can be rewritten to the configured internal API base URL while handling base-path variations more robustly.

Changes:

  • Refactors validateAndRewritePublicWebhookUrl to normalize/strip base paths and extract the webhook sync route before rewriting.
  • Expands unit tests into parameterized cases covering more public/internal base-path combinations and trailing slash scenarios.
  • Preserves query string and hash when rewriting to the internal API URL.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
packages/blocks/http/src/lib/common/webhook-url-validator.ts Adds base-path normalization/extraction helpers and rewrites matching webhook sync URLs to the internal API URL (including search/hash).
packages/blocks/http/test/webhook-url-validator.test.ts Converts rewrite/throw tests to test.each with broader coverage of base-path and slash combinations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/blocks/http/src/lib/common/webhook-url-validator.ts
Comment thread packages/blocks/http/src/lib/common/webhook-url-validator.ts
Comment thread packages/blocks/http/src/lib/common/webhook-url-validator.ts
Comment thread packages/blocks/http/test/webhook-url-validator.test.ts Outdated
@sonarqubecloud
Copy link
Copy Markdown

@MarceloRGonc MarceloRGonc merged commit 803a9f6 into main Apr 10, 2026
25 checks passed
@MarceloRGonc MarceloRGonc deleted the mg/fix branch April 10, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants