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

Remove Range header after Seek to origin #1649

Merged
merged 1 commit into from May 4, 2022

Conversation

flobernd
Copy link
Contributor

@flobernd flobernd commented May 4, 2022

When reading data using ReadAt() and seeking to the origin using Seek(0, 0) afterwards, the old Range header is still included in the request. This causes any subsequent Read() operation to start at the offset previously passed to ReadAt().

The commit in this PR fixes that behaviour.

@klauspost
Copy link
Contributor

@flobernd Thanks for the contribution. This seems to trigger some tests failures.

=== RUN   TestSetHeader
Error:     get-options_test.go:55: Test 5: Expected range header 'bytes=0-0', but got ''

This seems functionally different. bytes=0-0 would return 1 byte. So this should be investigated, if the test is wrong or the change.

=== RUN   TestGetObjectCore
Error:     core_test.go:206: Error: GetObject read shorter bytes before reaching EOF, want 946344, got 1

This also seems something that should be double checked.

@flobernd
Copy link
Contributor Author

flobernd commented May 4, 2022

@klauspost Let's try a different way :-)

Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

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

LGTM

@harshavardhana harshavardhana merged commit 1a65a83 into minio:master May 4, 2022
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.

None yet

3 participants