Skip to content

Commit 53107e8

Browse files
Add Content-Type assertions to request signing endpoint tests
1 parent 945189c commit 53107e8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

crates/trusted-server-core/src/request_signing/endpoints.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,11 @@ mod tests {
366366
let mut resp =
367367
handle_verify_signature(&settings, req).expect("should handle verification request");
368368
assert_eq!(resp.get_status(), StatusCode::OK);
369+
assert_eq!(
370+
resp.get_content_type(),
371+
Some(fastly::mime::APPLICATION_JSON),
372+
"should return application/json content type"
373+
);
369374

370375
// Parse response
371376
let resp_body = resp.take_body_str();
@@ -403,6 +408,11 @@ mod tests {
403408
let mut resp =
404409
handle_verify_signature(&settings, req).expect("should handle verification request");
405410
assert_eq!(resp.get_status(), StatusCode::OK);
411+
assert_eq!(
412+
resp.get_content_type(),
413+
Some(fastly::mime::APPLICATION_JSON),
414+
"should return application/json content type"
415+
);
406416

407417
// Parse response
408418
let resp_body = resp.take_body_str();
@@ -584,6 +594,11 @@ mod tests {
584594
match result {
585595
Ok(mut resp) => {
586596
assert_eq!(resp.get_status(), StatusCode::OK);
597+
assert_eq!(
598+
resp.get_content_type(),
599+
Some(fastly::mime::APPLICATION_JSON),
600+
"should return application/json content type"
601+
);
587602
let body = resp.take_body_str();
588603

589604
// Parse the discovery document

0 commit comments

Comments
 (0)