relay_server/services/processor/
standalone.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::envelope::ItemType;
use crate::services::processor::StandaloneGroup;
use crate::utils::{ItemAction, TypedEnvelope};

/// Processes a standalone envelope by removing unnecessary items.
///
/// This function removes form data items from the envelope since they are not allowed in
/// standalone processing.
pub fn process(managed_envelope: &mut TypedEnvelope<StandaloneGroup>) {
    managed_envelope.retain_items(|i| match i.ty() {
        ItemType::FormData => ItemAction::DropSilently,
        _ => ItemAction::Keep,
    });
}