mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
make sure url ends with slash (#110)
This commit is contained in:
parent
0487555c63
commit
155566bbd5
1 changed files with 7 additions and 5 deletions
|
@ -11,11 +11,6 @@ import (
|
|||
|
||||
"github.com/go-errors/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/xanzy/go-gitlab"
|
||||
"golang.org/x/sync/semaphore"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
|
||||
"github.com/trufflesecurity/trufflehog/v3/pkg/giturl"
|
||||
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/source_metadatapb"
|
||||
|
@ -23,6 +18,10 @@ import (
|
|||
"github.com/trufflesecurity/trufflehog/v3/pkg/sanitizer"
|
||||
"github.com/trufflesecurity/trufflehog/v3/pkg/sources"
|
||||
"github.com/trufflesecurity/trufflehog/v3/pkg/sources/git"
|
||||
"github.com/xanzy/go-gitlab"
|
||||
"golang.org/x/sync/semaphore"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
type Source struct {
|
||||
|
@ -77,6 +76,9 @@ func (s *Source) Init(aCtx context.Context, name string, jobId, sourceId int64,
|
|||
|
||||
s.repos = conn.Repositories
|
||||
s.url = conn.Endpoint
|
||||
if !strings.HasSuffix(s.url, "/") {
|
||||
s.url = s.url + "/"
|
||||
}
|
||||
switch cred := conn.GetCredential().(type) {
|
||||
case *sourcespb.GitLab_Token:
|
||||
s.authMethod = "TOKEN"
|
||||
|
|
Loading…
Reference in a new issue