@@ -49,25 +49,6 @@ func (rc *requestContext) VerifyLink(oid string) string {
49
49
return setting .AppURL + path .Join (rc .User , rc .Repo + ".git" , "info/lfs/verify" , oid )
50
50
}
51
51
52
- // ObjectOidHandler is the main request routing entry point into LFS server functions
53
- func ObjectOidHandler (ctx * context.Context ) {
54
- if ctx .Req .Method == "GET" || ctx .Req .Method == "HEAD" {
55
- if isValidAccept (ctx .Req ) {
56
- getMetaHandler (ctx )
57
- return
58
- }
59
-
60
- getContentHandler (ctx )
61
- return
62
- } else if ctx .Req .Method == "PUT" {
63
- PutHandler (ctx )
64
- return
65
- }
66
-
67
- log .Warn ("Unhandled LFS method: %s for %s/%s OID[%s]" , ctx .Req .Method , ctx .Params ("username" ), ctx .Params ("reponame" ), ctx .Params ("oid" ))
68
- writeStatus (ctx , http .StatusNotFound )
69
- }
70
-
71
52
func getAuthenticatedRepoAndMeta (ctx * context.Context , rc * requestContext , p lfs_module.Pointer , requireWrite bool ) (* models.LFSMetaObject , * models.Repository ) {
72
53
if ! p .IsValid () {
73
54
log .Info ("Attempt to access invalid LFS OID[%s] in %s/%s" , p .Oid , rc .User , rc .Repo )
@@ -97,8 +78,8 @@ func getAuthenticatedRepoAndMeta(ctx *context.Context, rc *requestContext, p lfs
97
78
return meta , repository
98
79
}
99
80
100
- // getContentHandler gets the content from the content store
101
- func getContentHandler (ctx * context.Context ) {
81
+ // DownloadHandler gets the content from the content store
82
+ func DownloadHandler (ctx * context.Context ) {
102
83
rc , p := unpack (ctx )
103
84
104
85
meta , _ := getAuthenticatedRepoAndMeta (ctx , rc , p , false )
@@ -174,8 +155,14 @@ func getContentHandler(ctx *context.Context) {
174
155
logRequest (ctx .Req , statusCode )
175
156
}
176
157
177
- // getMetaHandler retrieves metadata about the object
178
- func getMetaHandler (ctx * context.Context ) {
158
+ // LegacyMetaHandler retrieves metadata about the object
159
+ func LegacyMetaHandler (ctx * context.Context ) {
160
+ if ! isValidAccept (ctx .Req ) {
161
+ log .Info ("Attempt to call without accepting the correct media type: %s" , lfs_module .MediaType )
162
+ writeStatus (ctx , http .StatusBadRequest )
163
+ return
164
+ }
165
+
179
166
rc , p := unpack (ctx )
180
167
181
168
meta , _ := getAuthenticatedRepoAndMeta (ctx , rc , p , false )
@@ -197,8 +184,8 @@ func getMetaHandler(ctx *context.Context) {
197
184
logRequest (ctx .Req , http .StatusOK )
198
185
}
199
186
200
- // PostHandler instructs the client how to upload data
201
- func PostHandler (ctx * context.Context ) {
187
+ // LegacyPostHandler instructs the client how to upload data
188
+ func LegacyPostHandler (ctx * context.Context ) {
202
189
if ! isValidAccept (ctx .Req ) {
203
190
log .Info ("Attempt to POST without accepting the correct media type: %s" , lfs_module .MediaType )
204
191
writeStatus (ctx , http .StatusBadRequest )
@@ -369,8 +356,8 @@ func BatchHandler(ctx *context.Context) {
369
356
logRequest (ctx .Req , http .StatusOK )
370
357
}
371
358
372
- // PutHandler receives data from the client and puts it into the content store
373
- func PutHandler (ctx * context.Context ) {
359
+ // UploadHandler receives data from the client and puts it into the content store
360
+ func UploadHandler (ctx * context.Context ) {
374
361
rc , p := unpack (ctx )
375
362
376
363
meta , repository := getAuthenticatedRepoAndMeta (ctx , rc , p , true )
0 commit comments