Skip to content

Commit

Permalink
osf provider: identify self to download provider
Browse files Browse the repository at this point in the history
  • Loading branch information
felliott committed Aug 8, 2016
1 parent 155f331 commit 0283cc6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mfr/providers/osf/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from mfr.core import exceptions
from mfr.core import provider
from mfr.providers.osf import settings

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -68,7 +69,8 @@ async def metadata(self):

async def download(self):
download_url = await self._fetch_download_url()
response = await self._make_request('GET', download_url, allow_redirects=False)
headers = {settings.MFR_IDENTIFYING_HEADER: '1'}
response = await self._make_request('GET', download_url, allow_redirects=False, headers=headers)

if response.status >= 400:
err_resp = await response.read()
Expand Down
2 changes: 2 additions & 0 deletions mfr/providers/osf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@


# BASE_URL = config.get('BASE_URL', 'http://localhost:5001/')

MFR_IDENTIFYING_HEADER = config.get('MFR_IDENTIFYING_HEADER', 'X-Cos-Mfr-Render-Request')

0 comments on commit 0283cc6

Please sign in to comment.