Skip to content

Commit

Permalink
feat: Replace default Health Ping URL to HTTPS (#1991)
Browse files Browse the repository at this point in the history
  • Loading branch information
1 parent 0cf7ac6 commit 5bc04f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/observatory/burst/config.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type HealthPingConfig struct {
unknownFields protoimpl.UnknownFields

// destination url, need 204 for success return
// default http://www.google.com/gen_204
// default https://connectivitycheck.gstatic.com/generate_204
Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
// connectivity check url
Connectivity string `protobuf:"bytes,2,opt,name=connectivity,proto3" json:"connectivity,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions app/observatory/burst/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ message Config {

message HealthPingConfig {
// destination url, need 204 for success return
// default http://www.google.com/gen_204
// default https://connectivitycheck.gstatic.com/generate_204
string destination = 1;
// connectivity check url
string connectivity = 2;
Expand All @@ -31,4 +31,4 @@ message HealthPingConfig {
int32 samplingCount = 4;
// ping timeout, int64 values of time.Duration
int64 timeout = 5;
}
}
5 changes: 4 additions & 1 deletion app/observatory/burst/healthping.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ func NewHealthPing(ctx context.Context, config *HealthPingConfig) *HealthPing {
}
}
if settings.Destination == "" {
settings.Destination = "http://www.google.com/gen_204"
// Destination URL, need 204 for success return default to chromium
// https://github.com/chromium/chromium/blob/main/components/safety_check/url_constants.cc#L10
// https://chromium.googlesource.com/chromium/src/+/refs/heads/main/components/safety_check/url_constants.cc#10
settings.Destination = "https://connectivitycheck.gstatic.com/generate_204"
}
if settings.Interval == 0 {
settings.Interval = time.Duration(1) * time.Minute
Expand Down

0 comments on commit 5bc04f3

Please sign in to comment.