fix: remove all unwrap() calls for safer error handling

This commit is contained in:
2026-01-25 18:15:19 +00:00
parent 92b6240213
commit 26237bff2d
2 changed files with 21 additions and 15 deletions

View File

@@ -2,7 +2,7 @@ use crate::AppState;
use axum::{
body::Bytes,
extract::{Path, State},
http::{header, StatusCode},
http::{header, HeaderName, StatusCode},
response::{IntoResponse, Response},
routing::{get, head, put},
Json, Router,
@@ -67,7 +67,7 @@ async fn start_upload(Path(name): Path<String>) -> Response {
StatusCode::ACCEPTED,
[
(header::LOCATION, location.clone()),
("Docker-Upload-UUID".parse().unwrap(), uuid),
(HeaderName::from_static("docker-upload-uuid"), uuid),
],
)
.into_response()
@@ -127,7 +127,7 @@ async fn put_manifest(
StatusCode::CREATED,
[
(header::LOCATION, location),
("Docker-Content-Digest".parse().unwrap(), digest),
(HeaderName::from_static("docker-content-digest"), digest),
],
)
.into_response()