Skip to content

fix: add required Content-Range header to PATCH test #576

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

Conversation

coryodaniel
Copy link

@coryodaniel coryodaniel commented May 30, 2025

The spec requires Content-Range header for PATCH requests, but the conformance test "PATCH request with blob in body should yield 202 response" omits this requirement. This creates a mismatch between the spec and the test suite.

The spec clearly states that for PATCH requests:

  • Content-Range is required
  • Must be inclusive on both ends
  • First chunk must begin with 0
  • Must match regex ^[0-9]+-[0-9]+$

This fix adds the required Content-Range header to the test, ensuring it properly validates spec compliance.

I implemented this a little hacky to illustrate, I wanted to make sure I wasn't misinterpreting the spec, but when I enforced the content-range header on PATCH in our registry, it caused the conformance test suite to fail.

Happy to move stuff into setup.go if you want it to be inline with the other setup variables. I didn't do it there since its not a "chunk" and that appears to be the naming convention. Anywho, thanks!

The spec requires Content-Range header for PATCH requests, but the conformance
test "PATCH request with blob in body should yield 202 response" omits this
requirement. This creates a mismatch between the spec and the test suite.

The spec clearly states that for PATCH requests:
- Content-Range is required
- Must be inclusive on both ends
- First chunk must begin with 0
- Must match regex ^[0-9]+-[0-9]+$

This fix adds the required Content-Range header to the test, ensuring it properly
validates spec compliance.
Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

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

This is the streaming upload, which we do not want to change to a chunked upload (that's already a separate test). See #506 for details. It's a deficiency in the spec, not in the conformance test.

@dmcgowan
Copy link
Member

Clarification in the spec is reasonable, removing from the conformance test is not the ideal solution though.

@dmcgowan dmcgowan closed this Jun 26, 2025
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