Fix PR #22 review findings: config edge cases and token type guard - #23
Merged
Conversation
- README: google-dns warn default is 35 ms, matching the config - TCP probe config entries use ?: so a false return from parse_url still falls back to the raw env value, and empty port env values fall back to the default instead of port 0 - TcpPingProbe accepts a null/empty host and returns a failing ProbeResult instead of throwing a TypeError - Authorize middleware ignores non-string token query params instead of letting hash_equals throw a TypeError (500) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3306 only applies to MySQL/MariaDB; pgsql defaults to 5432 and sqlsrv to 1433 when DB_PORT is not set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up fixes for the review findings on #22 (excluding the breaking-change changelog item).
NETWATCH_PROBE_GOOGLE_DNS_WARN_MSis documented as 35, matching the config default (Add TCP probes, secure-by-default health route, and robust config defaults #22 changed the config but only updated the Cloudflare line in the README).?:instead of??for the host fallback, so afalsereturn fromparse_url()on malformed input still falls back to the raw env value. Ports use(int) (env(...) ?: default), so an emptyDB_PORT/REDIS_PORTuses the default instead of port 0.DB_PORTis not set, thedatabase-tcpprobe defaults byDB_CONNECTION(pgsql5432,sqlsrv1433, otherwise 3306) instead of always assuming MySQL.TcpPingProbe: accepts a nullable host and returns a failingProbeResult("no host configured") instead of throwing a TypeError when the host env var is unset but the probe is enabled.Authorizemiddleware: the token check requires a non-empty string before callinghash_equals(), so?token[]=xgets a 403 instead of a TypeError (500).Testing
vendor/bin/pint --testpasses.vendor/bin/pest: 132 passed (456 assertions), including 3 new regression tests for the null host, empty host, and array token cases.🤖 Generated with Claude Code