Skip to content
Merged
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
9 changes: 9 additions & 0 deletions crates/key-value-azure/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ impl Store for AzureCosmosStore {
}

async fn set(&self, key: &str, value: &[u8]) -> Result<(), Error> {
let illegal_chars = ['/', '\\', '?', '#'];

if key.contains(|c| illegal_chars.contains(&c)) {
return Err(Error::Other(format!(
"Key contains an illegal character. Keys must not include any of: {}",
illegal_chars.iter().collect::<String>()
)));
}

let pair = Pair {
id: key.to_string(),
value: value.to_vec(),
Expand Down
Loading