Skip to content

fix: report a redirected webhook URL instead of silently posting nothing - #167

Closed
vitali87 wants to merge 2 commits into
fix/notify-url-schemefrom
fix/webhook-redirects
Closed

vitali87 wants to merge 2 commits into
fix/notify-url-schemefrom
fix/webhook-redirects

Conversation

@vitali87

Copy link
Copy Markdown
Owner

Summary

_send_webhook used a plain urllib.request.urlopen. On a 301/302/303 urllib re-issues the request as a body-less GET, so a webhook URL that had moved (http→https upgrade, trailing-slash redirect, custom domain) received an empty GET while pr-split logged "Webhook notification sent to …" — the payload was silently lost.

A _NoRedirect handler now refuses every redirect and reports it through the existing warning path: Failed to send webhook notification: HTTP Error 301: redirected to https://…/hook; update the webhook URL. (307/308 were already refused by the stdlib for POST; only the message changes for them.)

Stacked on #164 (stack #99 = #67→#98→#103→#160→#164→this).

Test plan

  • real local servers: a 301 to a second server → the target receives nothing, the warning names the new location, no success line; a direct POST still delivers the JSON body — the redirect test fails on the base
  • existing mocked webhook tests now patch the opener
  • Review probed 301/302/303/307/308, socket cleanup, and the single main-thread caller
  • 468 tests pass, ruff clean
  • Local review: 5/5

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a70a758c-9e7b-4fd6-a4f3-f8c52c7be172

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Resolved via the updated fix/notify-url-scheme (which already contains
origin/main).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015rnEEjXWDBdePRhKMmZr1w

Copy link
Copy Markdown
Owner Author

This change is already in main: it landed via the merge train #243, which includes this PR's head commit. GitHub can't mark a stacked PR merged when it lands that way, so I'm closing it as done.


Generated by Claude Code

@vitali87 vitali87 closed this Sep 27, 2026
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.

2 participants