Skip to content

Commit fb49d7a

Browse files
committed
clear any auth from the endpoint url at program load
1 parent a6113fb commit fb49d7a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

cmd/src/code_intel_upload.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ func makeCodeIntelUploadURL(uploadID int) string {
191191
u := *cfg.endpointURL
192192
graphqlID := base64.URLEncoding.EncodeToString(fmt.Appendf(nil, `SCIPUpload:%d`, uploadID))
193193
u.Path = codeintelUploadFlags.repo + "/-/code-intelligence/uploads/" + graphqlID
194-
u.User = nil
195194
return u.String()
196195
}
197196

cmd/src/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ func parseEndpoint(endpoint string) (*url.URL, error) {
119119
if u.Host == "" {
120120
return nil, errors.Newf("empty host")
121121
}
122+
// auth in the URL is not used, and could be explosed in log output.
123+
// Explicitly clear it in case it's accidentally set in SRC_ENDPOINT or the config file.
124+
u.User = nil
122125
return u, nil
123126
}
124127

0 commit comments

Comments
 (0)