@@ -166,87 +166,6 @@ func DownloadHandler(ctx *context.Context) {
166
166
logRequest (ctx .Req , statusCode )
167
167
}
168
168
169
- // LegacyMetaHandler retrieves metadata about the object
170
- func LegacyMetaHandler (ctx * context.Context ) {
171
- rc , p := unpack (ctx )
172
-
173
- meta , _ := getAuthenticatedRepoAndMeta (ctx , rc , p , false )
174
- if meta == nil {
175
- // Status already written in getAuthenticatedRepoAndMeta
176
- return
177
- }
178
-
179
- ctx .Resp .Header ().Set ("Content-Type" , lfs_module .MediaType )
180
-
181
- if ctx .Req .Method == "GET" {
182
- json := jsoniter .ConfigCompatibleWithStandardLibrary
183
- enc := json .NewEncoder (ctx .Resp )
184
- if err := enc .Encode (buildObjectResponse (rc , meta .Pointer , true , false , 0 )); err != nil {
185
- log .Error ("Failed to encode representation as json. Error: %v" , err )
186
- }
187
- }
188
-
189
- logRequest (ctx .Req , http .StatusOK )
190
- }
191
-
192
- // LegacyPostHandler instructs the client how to upload data
193
- func LegacyPostHandler (ctx * context.Context ) {
194
- rc , p := unpack (ctx )
195
-
196
- repository , err := models .GetRepositoryByOwnerAndName (rc .User , rc .Repo )
197
- if err != nil {
198
- log .Error ("Unable to get repository: %s/%s Error: %v" , rc .User , rc .Repo , err )
199
- writeStatus (ctx , http .StatusNotFound )
200
- return
201
- }
202
-
203
- if ! authenticate (ctx , repository , rc .Authorization , true ) {
204
- requireAuth (ctx )
205
- return
206
- }
207
-
208
- if ! p .IsValid () {
209
- log .Info ("Invalid LFS OID[%s] attempt to POST in %s/%s" , p .Oid , rc .User , rc .Repo )
210
- writeStatus (ctx , http .StatusNotFound )
211
- return
212
- }
213
-
214
- if setting .LFS .MaxFileSize > 0 && p .Size > setting .LFS .MaxFileSize {
215
- log .Info ("Denied LFS OID[%s] upload of size %d to %s/%s because of LFS_MAX_FILE_SIZE=%d" , p .Oid , p .Size , rc .User , rc .Repo , setting .LFS .MaxFileSize )
216
- writeStatus (ctx , http .StatusRequestEntityTooLarge )
217
- return
218
- }
219
-
220
- meta , err := models .NewLFSMetaObject (& models.LFSMetaObject {Pointer : p , RepositoryID : repository .ID })
221
- if err != nil {
222
- log .Error ("Unable to write LFS OID[%s] size %d meta object in %v/%v to database. Error: %v" , p .Oid , p .Size , rc .User , rc .Repo , err )
223
- writeStatus (ctx , http .StatusNotFound )
224
- return
225
- }
226
-
227
- ctx .Resp .Header ().Set ("Content-Type" , lfs_module .MediaType )
228
-
229
- sentStatus := http .StatusAccepted
230
- contentStore := lfs_module .NewContentStore ()
231
- exist , err := contentStore .Exists (p )
232
- if err != nil {
233
- log .Error ("Unable to check if LFS OID[%s] exist on %s / %s. Error: %v" , p .Oid , rc .User , rc .Repo , err )
234
- writeStatus (ctx , http .StatusInternalServerError )
235
- return
236
- }
237
- if meta .Existing && exist {
238
- sentStatus = http .StatusOK
239
- }
240
- ctx .Resp .WriteHeader (sentStatus )
241
-
242
- json := jsoniter .ConfigCompatibleWithStandardLibrary
243
- enc := json .NewEncoder (ctx .Resp )
244
- if err := enc .Encode (buildObjectResponse (rc , meta .Pointer , meta .Existing , true , 0 )); err != nil {
245
- log .Error ("Failed to encode representation as json. Error: %v" , err )
246
- }
247
- logRequest (ctx .Req , sentStatus )
248
- }
249
-
250
169
// BatchHandler provides the batch api
251
170
func BatchHandler (ctx * context.Context ) {
252
171
bv := unpackbatch (ctx )
0 commit comments