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

Partial put - enhance content range verification #778

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Chenjp
Copy link
Contributor

@Chenjp Chenjp commented Nov 15, 2024

per rfc 9110 - 14.4

  • ContentRange - add isValid(), more length check.
  • ContentRange - parse(): make sure the not-null return of parse() is valid.
  • force content-range unit in lowercase internally.
  • TestDefaultServletPut - cover issues by adding 2 sets of parameters.

ContentRange - add isValid(), more length check.
ContentRange - parse(): make sure the not-null return of parse() is valid.
force content-range unit in lowercase internally.
TestDefaultServletPut - partial put
@rmaucher
Copy link
Contributor

-1
Other that the lower case range, the shuffling around of the checks introduces a much more serious bug (&& length > end).

@Chenjp
Copy link
Contributor Author

Chenjp commented Nov 15, 2024

-1 Other that the lower case range, the shuffling around of the checks introduces a much more serious bug (&& length > end).

A Content-Range field value is invalid if it contains a range-resp that has a last-pos value less than its first-pos value, or a complete-length value less than or equal to its last-pos value.

@rmaucher
Copy link
Contributor

Ok, that's correct, the end is also inclusive.

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.

2 participants