test(axum): close package mutation gate
Exercise every state, typed-form, async, and result registration family; replace fallible numeric headers with typed HeaderValue construction; and classify only validated equivalent multipart/header mutants. req: axum_integration/003 req: derive_handler/005 req: multipart/003 req: test/020 req: test/021 req: test/022
This commit is contained in:
+9
-11
@@ -1347,10 +1347,10 @@ impl IntoResponse for PageResponse {
|
||||
.headers_mut()
|
||||
.insert(HEMX_PARTIAL_HEADER, HeaderValue::from_static("true"));
|
||||
}
|
||||
if let Some(fingerprint) = self.fingerprint.and_then(fingerprint_header) {
|
||||
if let Some(fingerprint) = self.fingerprint {
|
||||
response
|
||||
.headers_mut()
|
||||
.insert(HEMX_FINGERPRINT_HEADER, fingerprint);
|
||||
.insert(HEMX_FINGERPRINT_HEADER, fingerprint_header(fingerprint));
|
||||
}
|
||||
if let Some(title) = self
|
||||
.title
|
||||
@@ -1380,8 +1380,8 @@ fn html_with_root_fingerprint(mut html: String, fingerprint: BuildFingerprint) -
|
||||
html
|
||||
}
|
||||
|
||||
fn fingerprint_header(fingerprint: BuildFingerprint) -> Option<HeaderValue> {
|
||||
HeaderValue::from_str(&fingerprint.0.to_string()).ok()
|
||||
fn fingerprint_header(fingerprint: BuildFingerprint) -> HeaderValue {
|
||||
HeaderValue::from(fingerprint.0)
|
||||
}
|
||||
|
||||
impl IntoResponse for EffectResponse {
|
||||
@@ -1392,11 +1392,10 @@ impl IntoResponse for EffectResponse {
|
||||
header::CONTENT_TYPE,
|
||||
HeaderValue::from_static(HEMX_CONTENT_TYPE),
|
||||
);
|
||||
if let Some(fingerprint) = fingerprint_header(self.batch.fingerprint) {
|
||||
response
|
||||
.headers_mut()
|
||||
.insert(HEMX_FINGERPRINT_HEADER, fingerprint);
|
||||
}
|
||||
response.headers_mut().insert(
|
||||
HEMX_FINGERPRINT_HEADER,
|
||||
fingerprint_header(self.batch.fingerprint),
|
||||
);
|
||||
response
|
||||
}
|
||||
}
|
||||
@@ -1442,8 +1441,7 @@ impl IntoResponse for RuntimeJs {
|
||||
);
|
||||
response.headers_mut().insert(
|
||||
header::CONTENT_LENGTH,
|
||||
HeaderValue::from_str(hemx_js::RUNTIME_JS.len().to_string().as_str())
|
||||
.expect("runtime length is a valid header value"),
|
||||
HeaderValue::from(hemx_js::RUNTIME_JS.len() as u64),
|
||||
);
|
||||
response
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user