Skip to content

Commit 63715dd

Browse files
committed
oops
Signed-off-by: Andrew Thornton <art27@cantab.net>
1 parent 4b31472 commit 63715dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

services/migrations/common.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func hasBaseURL(toCheck, baseURL string) bool {
2626
if len(baseURL) > 0 && baseURL[len(baseURL)-1] != '/' {
2727
baseURL += "/"
2828
}
29-
return strings.HasPrefix(toCheck, baseURL+"/")
29+
return strings.HasPrefix(toCheck, baseURL)
3030
}
3131

3232
// CheckAndEnsureSafePR will check that a give PR is safe
@@ -35,15 +35,15 @@ func CheckAndEnsureSafePR(pr *base.PullRequest, commonCloneBaseURL string, g bas
3535
// SECURITY: the patchURL must be checked to have the same baseURL as the current to prevent open redirect
3636
if pr.PatchURL != "" && !hasBaseURL(pr.PatchURL, commonCloneBaseURL) {
3737
// TODO: Should we check that this url has the expected format for a patch url?
38-
WarnAndNotice("PR #%d in %s has invalid PatchURL: %s", pr.Number, g, pr.PatchURL)
38+
WarnAndNotice("PR #%d in %s has invalid PatchURL: %s baseURL: %s", pr.Number, g, pr.PatchURL, commonCloneBaseURL)
3939
pr.PatchURL = ""
4040
valid = false
4141
}
4242

4343
// SECURITY: the headCloneURL must be checked to have the same baseURL as the current to prevent open redirect
4444
if pr.Head.CloneURL != "" && !hasBaseURL(pr.Head.CloneURL, commonCloneBaseURL) {
4545
// TODO: Should we check that this url has the expected format for a patch url?
46-
WarnAndNotice("PR #%d in %s has invalid HeadCloneURL: %s", pr.Number, g, pr.Head.CloneURL)
46+
WarnAndNotice("PR #%d in %s has invalid HeadCloneURL: %s baseURL: %s", pr.Number, g, pr.Head.CloneURL, commonCloneBaseURL)
4747
pr.Head.CloneURL = ""
4848
valid = false
4949
}

0 commit comments

Comments
 (0)