Skip to content

Set octet-stream content-type on put request#4017

Merged
estesp merged 1 commit intocontainerd:masterfrom
bloodorangeio:octet-stream-fix
Feb 12, 2020
Merged

Set octet-stream content-type on put request#4017
estesp merged 1 commit intocontainerd:masterfrom
bloodorangeio:octet-stream-fix

Conversation

@jdolitsky
Copy link
Copy Markdown
Contributor

According to the spec:

Monolithic Upload
A monolithic upload is simply a chunked upload with a single chunk and MAY be favored by clients that would like to avoided the complexity of chunking. To carry out a "monolithic" upload, one can simply put the entire content blob to the provided URL:

PUT /v2/<name>/blobs/uploads/<session_id>?digest=<digest>
Content-Length: <size of layer>
Content-Type: application/octet-stream

<Layer Binary Data>

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Feb 12, 2020

Build succeeded.

@jdolitsky
Copy link
Copy Markdown
Contributor Author

For context -
I found this issue trying to use Helm client to push a chart to zot registry. Helm uses ORAS, which uses containerd. After that one-line change, things work fine. Zot was returning a "415 Unsupported Media Type" on monolithic upload if the Content-Type header was not "application/octet-stream". Containerd (or underlying net/http) appears to use "text/plain" if it is not set explicitly

Copy link
Copy Markdown
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #4017 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4017      +/-   ##
==========================================
- Coverage   42.64%   42.64%   -0.01%     
==========================================
  Files         130      130              
  Lines       14763    14764       +1     
==========================================
  Hits         6296     6296              
- Misses       7548     7549       +1     
  Partials      919      919
Flag Coverage Δ
#linux 46.01% <0%> (-0.01%) ⬇️
#windows 38.22% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
remotes/docker/pusher.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cbf3ee0...d8a0d29. Read the comment docs.

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

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.

4 participants