Skip to content

Commit 5f68237

Browse files
committed
Made method private.
1 parent 6a8a4a9 commit 5f68237

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

services/lfs/locks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func checkIsValidRequest(ctx *context.Context) bool {
2626
writeStatus(ctx, http.StatusNotFound)
2727
return false
2828
}
29-
if !MetaMatcher(ctx.Req) {
29+
if !isValidAccept(ctx.Req) {
3030
log.Info("Attempt access LOCKs without accepting the correct media type: %s", lfs_module.MediaType)
3131
writeStatus(ctx, http.StatusBadRequest)
3232
return false

services/lfs/server.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func ObjectOidHandler(ctx *context.Context) {
5858
}
5959

6060
if ctx.Req.Method == "GET" || ctx.Req.Method == "HEAD" {
61-
if MetaMatcher(ctx.Req) {
61+
if isValidAccept(ctx.Req) {
6262
getMetaHandler(ctx)
6363
return
6464
}
@@ -211,7 +211,7 @@ func PostHandler(ctx *context.Context) {
211211
return
212212
}
213213

214-
if !MetaMatcher(ctx.Req) {
214+
if !isValidAccept(ctx.Req) {
215215
log.Info("Attempt to POST without accepting the correct media type: %s", lfs_module.MediaType)
216216
writeStatus(ctx, http.StatusBadRequest)
217217
return
@@ -281,7 +281,7 @@ func BatchHandler(ctx *context.Context) {
281281
return
282282
}
283283

284-
if !MetaMatcher(ctx.Req) {
284+
if !isValidAccept(ctx.Req) {
285285
log.Info("Attempt to BATCH without accepting the correct media type: %s", lfs_module.MediaType)
286286
writeStatus(ctx, http.StatusBadRequest)
287287
return
@@ -402,7 +402,7 @@ func VerifyHandler(ctx *context.Context) {
402402
return
403403
}
404404

405-
if !MetaMatcher(ctx.Req) {
405+
if !isValidAccept(ctx.Req) {
406406
log.Info("Attempt to VERIFY without accepting the correct media type: %s", lfs_module.MediaType)
407407
writeStatus(ctx, http.StatusBadRequest)
408408
return
@@ -473,9 +473,9 @@ func represent(rc *requestContext, pointer lfs_module.Pointer, download, upload
473473
return rep
474474
}
475475

476-
// MetaMatcher provides a mux.MatcherFunc that only allows requests that contain
476+
// isValidAccept provides a mux.MatcherFunc that only allows requests that contain
477477
// an Accept header with the lfs_module.MediaType
478-
func MetaMatcher(r *http.Request) bool {
478+
func isValidAccept(r *http.Request) bool {
479479
mediaParts := strings.Split(r.Header.Get("Accept"), ";")
480480
mt := mediaParts[0]
481481
return mt == lfs_module.MediaType

0 commit comments

Comments
 (0)