-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
monitor: be more lenient and more strict about AUTOGRAPH_URL (#1012)
Before this patch, AUTOGRAPH_URL was required to include a trailing slash in order to be considered valid but wasn't required to be an actual URL. We use url.JoinPath so that if we forget the trailing slash in the `AUTOGRAPH_URL` env var for the autograph-monitor, things still work correctly. Before this, the autograph-monitor was trying to resolve `"${AUTOGRAPH_URL}__monitor__"` as a domain name when you forgot the trailing slash. Along the way, we refactor and test our URL parsing of `AUTOGRAPH_URL`. We also handle some `err` shadowing in `main` that was getting complicated by renaming one error variable to `rootErr` and relying on `errors.Join`'s behavior of returning `nil` if all its error arguments are `nil`.
- Loading branch information
Showing
2 changed files
with
88 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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