@@ -47,10 +47,19 @@ var pluginOptionSanitizers = map[string]func(map[string]interface{}){
4747 "gitextractor" : func (options map [string ]interface {}) {
4848 if v , ok := options ["url" ]; ok {
4949 gitUrl := cast .ToString (v )
50- u , _ := url .Parse (gitUrl )
50+ u , err := url .Parse (gitUrl )
51+ if err != nil {
52+ logger .Error (err , "failed to parse git url" , gitUrl )
53+ }
5154 if u != nil && u .User != nil {
5255 password , ok := u .User .Password ()
5356 if ok {
57+ escapedUrl , err := url .QueryUnescape (gitUrl )
58+ if err != nil {
59+ logger .Warn (err , "failed to unescape url %s" , gitUrl )
60+ } else {
61+ gitUrl = escapedUrl
62+ }
5463 gitUrl = strings .Replace (gitUrl , password , strings .Repeat ("*" , len (password )), - 1 )
5564 options ["url" ] = gitUrl
5665 }
@@ -148,7 +157,8 @@ func SanitizeBlueprint(blueprint *models.Blueprint) error {
148157func SanitizePipeline (pipeline * models.Pipeline ) error {
149158 for planStageIdx , pipelineStage := range pipeline .Plan {
150159 for planTaskIdx := range pipelineStage {
151- pipelineTask , err := SanitizeTask (pipeline.Plan [planStageIdx ][planTaskIdx ])
160+ task := pipeline.Plan [planStageIdx ][planTaskIdx ]
161+ pipelineTask , err := SanitizeTask (task )
152162 if err != nil {
153163 return err
154164 }
0 commit comments