Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Internal] Single-shot upload reports content length if known #919

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ksafonov-db
Copy link
Contributor

@ksafonov-db ksafonov-db commented Mar 7, 2025

What changes are proposed in this pull request?

When performing single-shot upload, determine content length (via utility method from Python requests library), and if length is known, fill the Content-Length HTTP header. Then server will respect this header to validate request body size against.

How is this tested?

Added unit test.

NO_CHANGELOG=true

@@ -1279,8 +1279,6 @@ def run(self, config: Config):

session = requests.Session()
with requests_mock.Mocker(session=session) as session_mock:
session_mock.get(f"http://localhost/api/2.0/fs/files{MultipartUploadTestCase.path}", status_code=200)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup

Copy link

github-actions bot commented Mar 7, 2025

Please ensure that the NEXT_CHANGELOG.md file is updated with any relevant changes.
If this is not necessary for your PR, please include the following in your PR description:
NO_CHANGELOG=true
and rerun the job.

Copy link

github-actions bot commented Mar 7, 2025

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-py

Inputs:

  • PR number: 919
  • Commit SHA: a780bba610aa41abf1504e0260b78f26ca6fc3ed

Checks will be approved automatically on success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant