Skip to content

Commit b721947

Browse files
Merge pull request #3056 from spinframework/main
Pull in last changes for v3.2 release
2 parents bd5457e + 099d22a commit b721947

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/key-value-azure/src/store.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ impl Store for AzureCosmosStore {
154154
}
155155

156156
async fn set(&self, key: &str, value: &[u8]) -> Result<(), Error> {
157+
let illegal_chars = ['/', '\\', '?', '#'];
158+
159+
if key.contains(|c| illegal_chars.contains(&c)) {
160+
return Err(Error::Other(format!(
161+
"Key contains an illegal character. Keys must not include any of: {}",
162+
illegal_chars.iter().collect::<String>()
163+
)));
164+
}
165+
157166
let pair = Pair {
158167
id: key.to_string(),
159168
value: value.to_vec(),

0 commit comments

Comments
 (0)