Skip to content

Commit 0517fbd

Browse files
authored
adminspace: Set proper encoding (#1934)
The encoding for adminspace query replies were left as the default `zenoh/bytes` when they're valid `application/json`.
1 parent 4f21cc6 commit 0517fbd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

zenoh/src/api/admin.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ pub(crate) fn on_admin_query(session: &WeakSession, prefix: &keyexpr, query: Que
104104
match serde_json::to_vec(&peer) {
105105
Ok(bytes) => {
106106
let reply_expr = KE_AT / own_zid / KE_SESSION / KE_TRANSPORT_UNICAST / zid;
107-
let _ = query.reply(reply_expr, bytes).wait();
107+
let _ = query
108+
.reply(reply_expr, bytes)
109+
.encoding(Encoding::APPLICATION_JSON)
110+
.wait();
108111
}
109112
Err(e) => tracing::debug!("Admin query error: {}", e),
110113
}
@@ -126,7 +129,10 @@ pub(crate) fn on_admin_query(session: &WeakSession, prefix: &keyexpr, query: Que
126129
/ zid
127130
/ KE_LINK
128131
/ lid;
129-
let _ = query.reply(reply_expr, bytes).wait();
132+
let _ = query
133+
.reply(reply_expr, bytes)
134+
.encoding(Encoding::APPLICATION_JSON)
135+
.wait();
130136
}
131137
Err(e) => tracing::debug!("Admin query error: {}", e),
132138
}

0 commit comments

Comments
 (0)