Skip to content

Commit

Permalink
Remove builder's specific path from panic
Browse files Browse the repository at this point in the history
Also fix the index out of range caused panic
  • Loading branch information
Jin Liu authored and jin-tron committed Jul 17, 2019
1 parent c0c17ca commit 2a42f44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/corehttp/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func parseRequest(request *http.Request) (*proxyRequest, error) {
}

split = strings.SplitN(path, "/", 7)
if split[3] != "x" || split[5] != "http" {
if len(split) < 7 || split[3] != "x" || split[5] != "http" {
return nil, fmt.Errorf("Invalid request path '%s'", path)
}

Expand Down
3 changes: 3 additions & 0 deletions mk/golang.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ unexport GOFLAGS
GOFLAGS ?=
GOTFLAGS ?=

# Try to make building as reproducible as possible by stripping the go path.
GOFLAGS += -asmflags=all=-trimpath="$(GOPATH)" -gcflags=all=-trimpath="$(GOPATH)"

ifeq ($(tarball-is),1)
GOFLAGS += -mod=vendor
endif
Expand Down

0 comments on commit 2a42f44

Please sign in to comment.