Skip to content

Commit 443a97b

Browse files
committed
docs: add comment on why we dont fail in absense
Signed-off-by: Gustavo Inacio <[email protected]>
1 parent ce9891e commit 443a97b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

crates/service/src/middleware/inject_receipt.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ use crate::service::TapReceipt;
88

99
/// Injects tap receipts in the extensions
1010
///
11+
/// A request won't always have a receipt because they might be
12+
/// free queries.
13+
/// That's why we don't fail with 400.
14+
///
1115
/// This is useful to not deserialize multiple times the same receipt
1216
pub async fn receipt_middleware(mut request: Request, next: Next) -> Response {
1317
if let Ok(TypedHeader(receipt)) = request.extract_parts::<TypedHeader<TapReceipt>>().await {

crates/service/src/middleware/inject_sender.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ impl From<Sender> for String {
3434

3535
/// Injects the sender found from the signer in the receipt
3636
///
37+
/// A request won't always have a receipt because they might be
38+
/// free queries.
39+
/// That's why we don't fail with 400.
40+
///
3741
/// Requires Receipt extension
3842
pub async fn sender_middleware(
3943
State(state): State<SenderState>,

0 commit comments

Comments
 (0)