Merge pull request #106 from Adityakk9031/fix/issue-82

fix(main): sanitize `remoteConfigURL` to prevent 400 Bad Request on bandwidth reports (#82)
This commit is contained in:
Owen Schwartz
2026-08-31 09:20:40 -04:00
committed by GitHub

View File

@@ -579,9 +579,12 @@ func main() {
logger.Fatal("You must provide either a config file or a remote config URL, not both")
}
// clean up the reomte config URL for backwards compatibility
// clean up the remote config URL for backwards compatibility
remoteConfigURL = strings.TrimRight(remoteConfigURL, "/")
remoteConfigURL = strings.TrimSuffix(remoteConfigURL, "/gerbil/get-config")
remoteConfigURL = strings.TrimSuffix(remoteConfigURL, "/")
remoteConfigURL = strings.TrimSuffix(remoteConfigURL, "/gerbil/receive-bandwidth")
remoteConfigURL = strings.TrimSuffix(remoteConfigURL, "/gerbil")
remoteConfigURL = strings.TrimRight(remoteConfigURL, "/")
var key wgtypes.Key
// if generateAndSaveKeyTo is provided, generate a private key and save it to the file. if the file already exists, load the key from the file