@@ -2,6 +2,7 @@ package actions
2
2
3
3
import (
4
4
"context"
5
+ "errors"
5
6
"fmt"
6
7
"net/http"
7
8
"net/url"
@@ -54,7 +55,7 @@ func addProxyRoutes(
54
55
}
55
56
supportPath := path .Join ("/sumdb" , sumdbURL .Host , "/supported" )
56
57
r .HandleFunc (supportPath , func (w http.ResponseWriter , r * http.Request ) {
57
- w .WriteHeader (200 )
58
+ w .WriteHeader (http . StatusOK )
58
59
})
59
60
sumHandler := sumdbProxy (sumdbURL , c .NoSumPatterns )
60
61
pathPrefix := "/sumdb/" + sumdbURL .Host
@@ -63,7 +64,7 @@ func addProxyRoutes(
63
64
)
64
65
}
65
66
66
- // Download Protocol
67
+ // Download Protocol:
67
68
// the download.Protocol and the stash.Stasher interfaces are composable
68
69
// in a middleware fashion. Therefore you can separate concerns
69
70
// by the functionality: a download.Protocol that just takes care
@@ -142,13 +143,13 @@ func getSingleFlight(l *log.Logger, c *config.Config, checker storage.Checker) (
142
143
return stash .WithSingleflight , nil
143
144
case "etcd" :
144
145
if c .SingleFlight == nil || c .SingleFlight .Etcd == nil {
145
- return nil , fmt . Errorf ( "Etcd config must be present" )
146
+ return nil , errors . New ( "etcd config must be present" )
146
147
}
147
148
endpoints := strings .Split (c .SingleFlight .Etcd .Endpoints , "," )
148
149
return stash .WithEtcd (endpoints , checker )
149
150
case "redis" :
150
151
if c .SingleFlight == nil || c .SingleFlight .Redis == nil {
151
- return nil , fmt . Errorf ( "Redis config must be present" )
152
+ return nil , errors . New ( "redis config must be present" )
152
153
}
153
154
return stash .WithRedisLock (
154
155
& athensLoggerForRedis {logger : l },
@@ -158,7 +159,7 @@ func getSingleFlight(l *log.Logger, c *config.Config, checker storage.Checker) (
158
159
c .SingleFlight .Redis .LockConfig )
159
160
case "redis-sentinel" :
160
161
if c .SingleFlight == nil || c .SingleFlight .RedisSentinel == nil {
161
- return nil , fmt . Errorf ( "Redis config must be present" )
162
+ return nil , errors . New ( "redis config must be present" )
162
163
}
163
164
return stash .WithRedisSentinelLock (
164
165
& athensLoggerForRedis {logger : l },
0 commit comments