Skip to content

Partial put - enhance content range verification#778

Merged
markt-asf merged 3 commits into
apache:mainfrom
Chenjp:verify_content_range
Nov 27, 2024
Merged

Partial put - enhance content range verification#778
markt-asf merged 3 commits into
apache:mainfrom
Chenjp:verify_content_range

Conversation

@Chenjp

@Chenjp Chenjp commented Nov 15, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@Chenjp

Chenjp commented Nov 15, 2024

Copy link
Copy Markdown
Contributor Author

-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
Copy Markdown
Contributor

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

@Chenjp

Chenjp commented Nov 21, 2024

Copy link
Copy Markdown
Contributor Author

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

@rmaucher any further comments?

@markt-asf markt-asf merged commit eb22c75 into apache:main Nov 27, 2024
markt-asf added a commit that referenced this pull request Nov 27, 2024
* enhance content range verification

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

* isValid: remove unnecessary condition.

---------

Co-authored-by: Mark Thomas <markt@apache.org>
markt-asf added a commit that referenced this pull request Nov 27, 2024
* enhance content range verification

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

* isValid: remove unnecessary condition.

---------

Co-authored-by: Mark Thomas <markt@apache.org>
markt-asf added a commit that referenced this pull request Nov 27, 2024
* enhance content range verification

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

* isValid: remove unnecessary condition.

---------

Co-authored-by: Mark Thomas <markt@apache.org>
@Chenjp Chenjp deleted the verify_content_range branch February 11, 2025 12:27
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