Skip to content

Commit

Permalink
Http EOS client: more robust url parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ffurano committed Jun 17, 2021
1 parent b6ff7a4 commit 1baa5a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/eosclient/eosgrpc/eos_http/eoshttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"net/http"
"net/url"
"os"
"path"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -240,7 +239,10 @@ func (c *Client) buildFullURL(urlpath, uid, gid string) (string, error) {
return "", err
}

u.Path = path.Join(u.Path, urlpath)
u, err = u.Parse(urlpath)
if err != nil {
return "", err
}

// I feel safer putting here a check, to prohibit malicious users to
// inject a false uid/gid into the url
Expand Down

0 comments on commit 1baa5a7

Please sign in to comment.