Skip to content

Commit 23ba1c2

Browse files
committed
fix(guard): serialize gateway actor keys correctly
1 parent 002a248 commit 23ba1c2

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

engine/packages/guard/src/routing/pegboard_gateway/resolve_actor_query.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ async fn resolve_query_target_dc_label(
216216

217217
fn serialize_actor_key(key: &[String]) -> Result<String> {
218218
const EMPTY_KEY: &str = "/";
219-
const KEY_SEPARATOR: char = '/';
219+
const KEY_SEPARATOR: &str = "/";
220+
const KEY_SEPARATOR_CHAR: char = '/';
220221

221222
if key.is_empty() {
222223
return Ok(EMPTY_KEY.to_string());
@@ -229,11 +230,13 @@ fn serialize_actor_key(key: &[String]) -> Result<String> {
229230
continue;
230231
}
231232

232-
let escaped = part.replace('\\', "\\\\").replace(KEY_SEPARATOR, "\\/");
233+
let escaped = part
234+
.replace('\\', "\\\\")
235+
.replace(KEY_SEPARATOR_CHAR, "\\/");
233236
escaped_parts.push(escaped);
234237
}
235238

236-
Ok(escaped_parts.join(EMPTY_KEY))
239+
Ok(escaped_parts.join(KEY_SEPARATOR))
237240
}
238241

239242
fn is_duplicate_key_error(err: &anyhow::Error) -> bool {

0 commit comments

Comments
 (0)