mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 23:15:49 +03:00
[GH-ISSUE #782] Incorrect URL validation #550
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#550
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @micalm on GitHub (Jan 26, 2023).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/782
When adding an integration, the URL sometimes is internal (when selfhosting), however healthchecks is reporting it as an invalid and returning a validation error.
For example - my ntfy topic is accessible via local DNS under
http://ntfy/healthcheck. I would expect this to work. Same goes for webhooks.One possible solution for URLs without the TLD (where
schema://domain.tld/) would be to soft fail and instead of red error validation message on backend, display maybe an orange warning like "Double check your URL - it seems incomplete".@cuu508 commented on GitHub (Jan 26, 2023):
Thanks for the report.
We have the INTEGRATIONS_ALLOW_PRIVATE_IPS setting. It this setting is enabled, it would make sense to also relax URL validation rules. I'll see what can be done here.
In the meantime, as a workaround, you can use the IP address instead of the hostname in the URL.
@cuu508 commented on GitHub (Jan 30, 2023):
I've now fixed the URL validation code to allow URLs with just hostname and no domain or tld.
http://ntfy/healthcheckshould work now.I did not tie the URL validation logic to the
INTEGRATIONS_ALLOW_PRIVATE_IPSsetting, because private IPs and "naked hostnames" are not the same thing:example.org A 192.168.0.1.ntfy A 1.2.3.4