Skip to content

Commit 14eecc9

Browse files
committed
updates for golang 1.5
It seems[1] go http.Client errors changed a bit for go 1.5. [1]: golang/go#9405
1 parent 6ae6da5 commit 14eecc9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ VERSION_VAR := main.ServerVersion
1717
GOTEST_FLAGS := -cpu=1,2
1818
GOBUILD_DEPFLAGS := -tags netgo
1919
GOBUILD_LDFLAGS ?=
20-
GOBUILD_FLAGS := ${GOBUILD_DEPFLAGS} -ldflags "${GOBUILD_LDFLAGS} -X ${VERSION_VAR} ${GOCAMO_VER}"
20+
GOBUILD_FLAGS := ${GOBUILD_DEPFLAGS} -ldflags "${GOBUILD_LDFLAGS} -X ${VERSION_VAR}=${GOCAMO_VER}"
2121
GO := env GOPATH="${GOPATH}" go
2222
XCOMPILE_ARCHES := darwin.amd64 freebsd.amd64 linux.amd64
2323

camo/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, req *http.Request) {
157157
// still having to rely on string comparison to find out if it is
158158
// a net.errClosing or not.
159159
errString := err.Error()
160-
if strings.Contains(errString, "timeout") {
160+
if strings.Contains(errString, "timeout") || strings.Contains(errString, "Client.Timeout") {
161161
http.Error(w, "Error Fetching Resource", http.StatusGatewayTimeout)
162162
} else if strings.Contains(errString, "use of closed") {
163163
http.Error(w, "Error Fetching Resource", http.StatusBadGateway)

camo/proxy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func TestTimeout(t *testing.T) {
243243

244244
errc := make(chan error, 1)
245245
go func() {
246-
_, err := processRequest(req, 502, c)
246+
_, err := processRequest(req, 504, c)
247247
errc <- err
248248
}()
249249

0 commit comments

Comments
 (0)