Skip to content

Commit

Permalink
Set blob content type to disable detection
Browse files Browse the repository at this point in the history
  • Loading branch information
phillebaba committed Jul 27, 2024
1 parent e030842 commit 27fa7d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#519](https://github.com/spegel-org/spegel/pull/519) Extend tests for containerd.
- [#520](https://github.com/spegel-org/spegel/pull/520) Add tests for metrics.
- [#536](https://github.com/spegel-org/spegel/pull/536) Update Go version to 1.22.5.
- [#547](https://github.com/spegel-org/spegel/pull/547) Set blob content type to disable detection.

### Deprecated

Expand Down
1 change: 1 addition & 0 deletions pkg/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ func (r *Registry) handleBlob(rw mux.ResponseWriter, req *http.Request, ref refe
rw.WriteError(http.StatusInternalServerError, fmt.Errorf("could not determine size of blob with digest %s: %w", ref.dgst.String(), err))
return
}
rw.Header().Set("Content-Type", "application/octet-stream")

Check warning on line 337 in pkg/registry/registry.go

View check run for this annotation

Codecov / codecov/patch

pkg/registry/registry.go#L337

Added line #L337 was not covered by tests
rw.Header().Set("Content-Length", strconv.FormatInt(size, 10))
rw.Header().Set("Docker-Content-Digest", ref.dgst.String())
if req.Method == http.MethodHead {
Expand Down

0 comments on commit 27fa7d6

Please sign in to comment.