[GH-ISSUE #782] Incorrect URL validation #550

Closed
opened 2026-02-25 23:42:50 +03:00 by kerem · 2 comments
Owner

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".

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".
kerem closed this issue 2026-02-25 23:42:50 +03:00
Author
Owner

@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.

<!-- gh-comment-id:1405101585 --> @cuu508 commented on GitHub (Jan 26, 2023): Thanks for the report. We have the [INTEGRATIONS_ALLOW_PRIVATE_IPS](https://healthchecks.io/docs/self_hosted_configuration/#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.
Author
Owner

@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/healthcheck should work now.

I did not tie the URL validation logic to the INTEGRATIONS_ALLOW_PRIVATE_IPS setting, because private IPs and "naked hostnames" are not the same thing:

  • A normal-looking URL can resolve to a private IP: example.org A 192.168.0.1.
  • And, conversely, when using a private DNS, a "naked hostname" can resolve to a public IP: ntfy A 1.2.3.4
<!-- gh-comment-id:1408440250 --> @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/healthcheck` should work now. I did not tie the URL validation logic to the `INTEGRATIONS_ALLOW_PRIVATE_IPS` setting, because private IPs and "naked hostnames" are not the same thing: * A normal-looking URL can resolve to a private IP: `example.org A 192.168.0.1`. * And, conversely, when using a private DNS, a "naked hostname" can resolve to a public IP: `ntfy A 1.2.3.4`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#550
No description provided.