@@ -651,31 +651,30 @@ where
651
651
if summary. attachment_quantity > 0 {
652
652
let item_scoping = scoping. item ( DataCategory :: Attachment ) ;
653
653
654
+ let attachment_byte_limits = self
655
+ . check
656
+ . apply ( item_scoping, summary. attachment_quantity ) ?;
657
+
654
658
enforcement. attachments = CategoryLimit :: new (
655
659
DataCategory :: Attachment ,
656
660
summary. attachment_quantity ,
657
- attachment_limits. longest ( ) ,
658
- ) ;
659
-
660
- attachment_limits. merge (
661
- self . check
662
- . apply ( item_scoping, summary. attachment_quantity ) ?,
661
+ attachment_byte_limits. longest ( ) ,
663
662
) ;
663
+ attachment_limits. merge ( attachment_byte_limits) ;
664
664
}
665
665
if !attachment_limits. is_limited ( ) && summary. attachment_item_quantity > 0 {
666
- "CHECKING ATTACHMENT ITEM LIMITS" ;
667
666
let item_scoping = scoping. item ( DataCategory :: AttachmentItem ) ;
668
667
668
+ let attachment_item_limits = self
669
+ . check
670
+ . apply ( item_scoping, summary. attachment_item_quantity ) ?;
671
+
669
672
enforcement. attachment_items = CategoryLimit :: new (
670
673
DataCategory :: AttachmentItem ,
671
674
summary. attachment_item_quantity ,
672
- attachment_limits. longest ( ) ,
673
- ) ;
674
-
675
- attachment_limits. merge (
676
- self . check
677
- . apply ( item_scoping, summary. attachment_item_quantity ) ?,
675
+ attachment_item_limits. longest ( ) ,
678
676
) ;
677
+ attachment_limits. merge ( attachment_item_limits) ;
679
678
}
680
679
681
680
// Only record rate limits for plain attachments. For all other attachments, it's
0 commit comments