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

Blob content type for chunked upload (in batch) should be validated #187

Open
vsoch opened this issue Sep 18, 2020 · 4 comments
Open

Blob content type for chunked upload (in batch) should be validated #187

vsoch opened this issue Sep 18, 2020 · 4 comments

Comments

@vsoch
Copy link
Contributor

vsoch commented Sep 18, 2020

Let's say that I generate an upload session for a blob. Each PATCH request is required to include a content type:

Content-Type: application/octet-stream
Content-Range: <range>
Content-Length: <length>

It's logical that on the first PATCH, I might not know the content type of the blob and can update it. But what happens if the content type changes on subsequent pushes? This should probably return some kind of error response, because (afaik) a blob can't have multiple content types for different chunks.

@jonjohnsonjr
Copy link
Contributor

AFAIK, the content type for blob uploads isn't semantically meaningful to the registry, since it's always just application/octet-stream.

I think it would be nice for the registry to know this, though...

@vsoch
Copy link
Contributor Author

vsoch commented Sep 20, 2020

It might also be useful to have (at least a suggestion) for a chunk size or number.

@vbatts
Copy link
Member

vbatts commented Jan 28, 2021

how do we propose to fix this?
It seems like behaviour that could be clarified in the docs, and without breaking existing behaviour, correct?

@vsoch
Copy link
Contributor Author

vsoch commented Jan 28, 2021

I think so - I was thinking that it would make sense to add a line to the spec that the content type of each subsequent PATCH is required to be the same as the first, and if it doesn't matches, maybe a particular response code is returned. I don't see any cases where it would be a good thing / realistic for a content type to change mid upload. Another idea would be that it's required for the first, but then just not checked for subsequent (and then errors could happen if the type changes, but this would be a user error).

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

No branches or pull requests

3 participants