Commit 58265a5 1 parent 8edf84e commit 58265a5 Copy full SHA for 58265a5
File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,9 @@ func (s *Server) buildMuxer() {
215
215
const apiPrefix = "/storage/v1"
216
216
s .mux = mux .NewRouter ()
217
217
218
+ // healthcheck
219
+ s .mux .Path ("/_internal/healthcheck" ).Methods (http .MethodGet ).HandlerFunc (s .healthcheck )
220
+
218
221
routers := []* mux.Router {
219
222
s .mux .PathPrefix (apiPrefix ).Subrouter (),
220
223
s .mux .MatcherFunc (s .publicHostMatcher ).PathPrefix (apiPrefix ).Subrouter (),
@@ -268,6 +271,10 @@ func (s *Server) buildMuxer() {
268
271
s .mux .Host ("{bucketName:.+}" ).Path ("/{objectName:.+}" ).Methods (http .MethodPost , http .MethodPut ).HandlerFunc (jsonToHTTPHandler (s .insertObject ))
269
272
}
270
273
274
+ func (s * Server ) healthcheck (w http.ResponseWriter , r * http.Request ) {
275
+ w .WriteHeader (http .StatusOK )
276
+ }
277
+
271
278
// publicHostMatcher matches incoming requests against the currently specified server publicHost.
272
279
func (s * Server ) publicHostMatcher (r * http.Request , rm * mux.RouteMatch ) bool {
273
280
if strings .Contains (s .publicHost , ":" ) || ! strings .Contains (r .Host , ":" ) {
You can’t perform that action at this time.
0 commit comments