Patchwork [2,of,4] lfs: add the 'Content-Type' header called out in the file transfer spec

login
register
mail settings
Submitter Matt Harbison
Date March 31, 2018, 10:28 p.m.
Message ID <40f0b221aee73bca2072.1522535305@Envy>
Download mbox | patch
Permalink /patch/30080/
State Accepted
Headers show

Comments

Matt Harbison - March 31, 2018, 10:28 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1519520219 18000
#      Sat Feb 24 19:56:59 2018 -0500
# Node ID 40f0b221aee73bca2072812062d0f112a134bedf
# Parent  0cd7c41df75ac914d95f398105317afb53f7e5db
lfs: add the 'Content-Type' header called out in the file transfer spec

https://github.com/git-lfs/git-lfs/blob/master/docs/api/basic-transfers.md#uploads

Patch

diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py
--- a/hgext/lfs/blobstore.py
+++ b/hgext/lfs/blobstore.py
@@ -332,6 +332,7 @@  class _gitlfsremote(object):
                                   hint=_('run hg verify'))
             request.data = filewithprogress(localstore.open(oid), None)
             request.get_method = lambda: 'PUT'
+            request.add_header('Content-Type', 'application/octet-stream')
 
         for k, v in headers:
             request.add_header(k, v)