diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 2e8b34687..c778be7c9 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -21,7 +21,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Cache Build Requirements id: pip-cache-step - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.pythonLocation }} key: ${{ env.GHA_DISTRO }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'dev-requirements.txt') }} @@ -44,7 +44,7 @@ jobs: with: python-version: 3.6 - name: Cache pip - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.pythonLocation }} key: ${{ env.GHA_DISTRO }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'dev-requirements.txt') }} diff --git a/tests/providers/onedrive/test_provider.py b/tests/providers/onedrive/test_provider.py index c6e1db59c..16e1852ad 100644 --- a/tests/providers/onedrive/test_provider.py +++ b/tests/providers/onedrive/test_provider.py @@ -516,7 +516,6 @@ async def test_download_standard_file_range(self, provider, download_fixtures): assert content == b'te' assert aiohttpretty.has_call(method='GET', uri=download_url, headers={'Range': 'bytes=0-1', - 'Authorization': 'bearer wrote harry potter', 'accept-encoding': ''}) @pytest.mark.asyncio diff --git a/waterbutler/providers/onedrive/provider.py b/waterbutler/providers/onedrive/provider.py index 5a028e2f8..3f41a2353 100644 --- a/waterbutler/providers/onedrive/provider.py +++ b/waterbutler/providers/onedrive/provider.py @@ -310,6 +310,7 @@ async def download(self, # type: ignore 'GET', download_url, range=range, + no_auth_header=True, # if download_url is signed, OD will sometimes 401 if auth header is included expects=(HTTPStatus.OK, HTTPStatus.PARTIAL_CONTENT), headers={'accept-encoding': ''}, throws=exceptions.DownloadError, @@ -766,6 +767,7 @@ async def _chunked_upload_stream_by_range(self, upload_url, data, start_range=0, start_range + len(data) - 1, total_size) }, + no_auth_header=True, # this endpoint will sometimes 401 if the Auth header included expects=(HTTPStatus.ACCEPTED, HTTPStatus.CREATED), throws=exceptions.UploadError )