Skip to content

Commit 7cc6565

Browse files
committed
impplemented fix for local domain
1 parent 7ca4004 commit 7cc6565

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

mfr/providers/osf/provider.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,9 @@ async def _make_request(self, method, url, *args, **kwargs):
206206
if self.authorization:
207207
kwargs.setdefault('headers', {})['Authorization'] = 'Bearer ' + self.token
208208

209+
if settings.OSF_DOMAIN:
210+
host = furl.furl(url).host
211+
url = url.replace(host, settings.OSF_DOMAIN)
212+
209213
async with aiohttp.request(method, url, *args, **kwargs) as response:
210214
return response

mfr/providers/osf/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55

66
MFR_IDENTIFYING_HEADER = config.get('MFR_IDENTIFYING_HEADER', 'X-Cos-Mfr-Render-Request')
77
MFR_ACTION_HEADER = config.get('MFR_ACTION_HEADER', 'X-Cos-Mfr-Request-Action')
8+
9+
OSF_DOMAIN = config.get('MFR_OSF_DOMAIN', None)

0 commit comments

Comments
 (0)