Skip to content

Add a host setting for probes - #9

Merged
tronyx merged 2 commits into
masterfrom
develop
Nov 22, 2026
Merged

tronyx merged 2 commits into
masterfrom
develop

Conversation

@tronyx

@tronyx tronyx commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Pull Request

By submitting this pull request, I confirm that:
(Tick each box that applies, e.g. [x].)

  • I've read the contributing guide and this whole template.
  • This pull request is against develop, and makes one change. (The release: develop into master.)
  • I've documented my change in docstrings, and updated the README if needed.
  • I've added a line about my change under Unreleased in CHANGELOG.md. (Moved under this release's heading.)
  • I've tested my change and added or updated tests for it.
  • python -m ruff check ., python -m ruff format --check . and python -m mypy pass.
  • My change works on Python 3.10 and doesn't add a required package.
  • My change never shows the Organizr API key or a password, and never sends them to Healthchecks.
  • For a new application: I tested its [[check]] table with --dry-run against a real copy, and named the version below.
  • I'm willing to help maintain this change if problems come up later.
  • I'm giving this submission freely and claim no ownership of it.

🎯 What does this pull request do?

Merges develop into master with a new probe setting, host. Snipe-IT 8.8.4 answers 400 to any Host header other than the host of its APP_URL, so an internal probe by IP address or localhost failed. A probe can now name the host that it sends.

🛠️ How does it do it?

  • Probe has a host field, and a probe table accepts host. It can use the names from [hosts]. An empty value, or a value with a scheme, a path or a space, is a config error.
  • fetch sends host as an unredirected Host header. A redirect to the same scheme, host and port gets it again, and a redirect to another host does not, the same rule as for the token and Authorization headers.
  • The snipe-it check of the example configuration tries /health instead of /login, and its internal probe sends host = "snipe-it.{domain}".
  • 9 new tests in tests/test_http.py and tests/test_config.py. 8 of them failed before the change.
  • __version__ is 2026-11-22, and the changelog entries are under this pull request.

Verified: 152 tests, ruff, ruff format and mypy pass locally on Python 3.14 in WSL. On develop (18c005c), every job of the Tests workflow passed (run 44904474262). A real snipe-it check with host gave 200 from both probes against Snipe-IT 8.8.4-alpine with --dry-run.

📝 Documentation changes

  • README: a host row in the probe settings, and a troubleshooting row for an internal probe that returns 400.
  • CHANGELOG: an Added entry and a Changed entry under this pull request.

🤖 Generated with Claude Code

tronyx and others added 2 commits November 21, 2026 07:32
Snipe-IT 8.8.4 answers 400 to any Host header other than the host of its
APP_URL, so the internal probe, which uses the IP address of the server,
failed. A probe can now set host, which it sends in the Host header. A
redirect to the same scheme, host and port keeps it, and a redirect to
another host does not.

The snipe-it check of the example configuration tries /health instead
of /login, and its internal probe sends snipe-it.{domain}. The README
and the changelog describe the setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tronyx
tronyx merged commit ec49608 into master Nov 22, 2026
13 checks passed
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.

1 participant