Skip to content

Commit

Permalink
Merge branch 'v3-dev' of https://github.com/pydio/cells into v3-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bsinou committed Feb 18, 2022
2 parents daaac6d + e1fe56f commit abd6d00
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions common/service/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ func JWTHttpWrapper(h http.Handler) http.Handler {
if val, ok1 := r.Header["Authorization"]; ok1 {

whole := strings.Join(val, "")
if !strings.HasPrefix(whole, "Bearer ") {
h.ServeHTTP(w, r)
return
}
rawIDToken := strings.TrimPrefix(strings.Trim(whole, ""), "Bearer ")
//var claims claim.Claims
var err error
Expand Down
11 changes: 10 additions & 1 deletion scheduler/actions/cmd/wget.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package cmd

import (
"context"
"crypto/tls"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -134,7 +135,15 @@ func (w *WGetAction) Run(ctx context.Context, channels *actions.RunnableChannels
}

log.TasksLogger(ctx).Info(fmt.Sprintf("Downloading file to %s from URL %s", targetNode.GetPath(), sourceUrl.String()))
httpResponse, err := http.Get(sourceUrl.String())
cli := http.DefaultClient
if targetNode.GetStringMeta(common.MetaNamespaceNodeTestLocalFolder) != "" {
// This is a unit test, skipVerify
transCfg := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // ignore expired SSL certificates
}
cli = &http.Client{Transport: transCfg}
}
httpResponse, err := cli.Get(sourceUrl.String())
if err != nil {
return input.WithError(err), err
}
Expand Down
2 changes: 1 addition & 1 deletion scheduler/actions/cmd/wget_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestWGetAction_Run(t *testing.T) {
job := &jobs.Job{}
action.Init(job, nil, &jobs.Action{
Parameters: map[string]string{
"url": "http://pydio.com/sites/default/files/Create%20a%20cell_4.png",
"url": "https://pydio.com/sites/default/files/Create%20a%20cell_4.png",
},
})

Expand Down

0 comments on commit abd6d00

Please sign in to comment.