Skip to content

Commit

Permalink
Removed apple auth headers from screenshot upload api (#6)
Browse files Browse the repository at this point in the history
* fix: Removed apple auth headers from screenshot upload api
  • Loading branch information
jawad-khan authored Sep 6, 2024
1 parent 5ea69a6 commit cddf271
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ecommerce/extensions/iap/api/v1/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ def test_upload_screenshot_of_inapp_purchase(self, _):
self.assertEqual(post_call.call_args[1]['headers'], headers)

self.assertEqual(put_call.call_args[0][0], 'https://image-url.com')
img_headers = headers.copy()
img_headers['Content-Type'] = 'image/png'
img_headers = {'Content-Type': 'image/png'}
self.assertEqual(put_call.call_args[1]['headers'], img_headers)

img_patch_url = 'https://api.appstoreconnect.apple.com/v1/inAppPurchaseAppStoreReviewScreenshots/1234'
Expand Down
3 changes: 1 addition & 2 deletions ecommerce/extensions/iap/api/v1/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ def upload_screenshot_of_inapp_purchase(in_app_purchase_id, headers):
screenshot_id = response['data']['id']
url = response['data']['attributes']['uploadOperations'][0]['url']
with staticfiles_storage.open('images/mobile_ios_product_screenshot.png', 'rb') as image:
img_headers = headers.copy()
img_headers['Content-Type'] = 'image/png'
img_headers = {'Content-Type': 'image/png'}
response = request_connect_store(url, headers=img_headers, data=image.read(), method='put')

if response.status_code != 200:
Expand Down

0 comments on commit cddf271

Please sign in to comment.