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

fix:set_file_content with range request return 416. #2010

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

sinnren
Copy link
Contributor

@sinnren sinnren commented Dec 24, 2024

in function "detail::range_error",check range pos and content_length:
// Range must be within content length if (!(0 <= first_pos && first_pos <= last_pos && last_pos <= contant_len - 1)) { return true; }

use res.set_file_content in callback, set "content_length_" in res.set_content_provider function, but res.set_content_provider is after "detail::range_error", cause "detail::range_error" return true(error).

to solve this problem,put "detail::range_error()" after file content served, it's ok.

@yhirose yhirose merged commit d647f48 into yhirose:master Dec 24, 2024
4 checks passed
@yhirose
Copy link
Owner

yhirose commented Dec 24, 2024

@sinnren thanks for your contribution!

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.

3 participants