Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions relay-general/src/store/normalize/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ fn normalize_url(request: &mut Request) {
};
}

#[allow(clippy::ptr_arg)] // normalize_method must be &mut String for `apply`.
fn normalize_method(method: &mut String, meta: &mut Meta) -> ProcessingResult {
method.make_ascii_uppercase();

Expand All @@ -86,6 +87,7 @@ fn normalize_method(method: &mut String, meta: &mut Meta) -> ProcessingResult {

Ok(())
}

/// Decodes an urlencoded body.
fn urlencoded_from_str(raw: &str) -> Option<Value> {
// Binary strings would be decoded, but we know url-encoded bodies are ASCII.
Expand Down
2 changes: 1 addition & 1 deletion relay-general/src/store/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ where
}

fn verify_value_characters(
value: &mut String,
value: &mut str,
meta: &mut Meta,
state: &ProcessingState<'_>,
) -> ProcessingResult {
Expand Down
6 changes: 3 additions & 3 deletions relay-server/src/utils/rate_limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ where
let mut enforcement = Enforcement::default();

if let Some(category) = summary.event_category {
let event_limits = (&mut self.check)(scoping.item(category), 1)?;
let event_limits = (self.check)(scoping.item(category), 1)?;
let longest = event_limits.longest();
enforcement.event = CategoryLimit::new(category, 1, longest);

Expand All @@ -381,7 +381,7 @@ where

if !enforcement.event.is_active() && summary.attachment_quantity > 0 {
let item_scoping = scoping.item(DataCategory::Attachment);
let attachment_limits = (&mut self.check)(item_scoping, summary.attachment_quantity)?;
let attachment_limits = (self.check)(item_scoping, summary.attachment_quantity)?;
enforcement.attachments = CategoryLimit::new(
DataCategory::Attachment,
summary.attachment_quantity,
Expand All @@ -398,7 +398,7 @@ where

if summary.session_quantity > 0 {
let item_scoping = scoping.item(DataCategory::Session);
let session_limits = (&mut self.check)(item_scoping, summary.session_quantity)?;
let session_limits = (self.check)(item_scoping, summary.session_quantity)?;
enforcement.sessions = CategoryLimit::new(
DataCategory::Session,
summary.session_quantity,
Expand Down