luxe 0.1.5: a provider picker, model ids, and a guided review that says less
The dock's provider row opens a list of providers, and the model picker opens on the provider in use, with tab to widen it; signing in opens it on the provider just signed in to. Models go by their id unless config names them, and the model row wears its maker's mark. The guided review's guide prompt is shorter, the pull request brief shows the start of the description with the rest behind p, its commits drop the Luxe-review and Luxe-revision lines, and the weakened-gates signal is gone. luxe update reruns the installer it was installed with, in place of luxe-cli-update. The preview's FILE tab reads files the session changed outside the project, and only those. Smaller fixes: bash headers are highlighted, the preview loses a blank row, the launcher divider sits inside its frame, and the phone app's top bar is clear of iOS's blur. rustls-webpki 0.103.16 and webpki-roots 1.0.10 fix RUSTSEC-2026-0381 and RUSTSEC-2026-0382, and vite 8.3.4 fixes GHSA-587h-7wmj-h5pm, GHSA-698v-4r3x-3vcv and GHSA-r825-w8mm-5pxw.
This commit is contained in:
@@ -137,7 +137,10 @@ async fn fetch_latest(url: &str) -> Result<String, String> {
|
||||
if !response.status().is_success() {
|
||||
return Err(format!("release manifest returned {}", response.status()));
|
||||
}
|
||||
let body = bounded_body(response).await?;
|
||||
let body = bounded_bytes(response, MAX_BODY_BYTES)
|
||||
.await
|
||||
.map_err(|error| format!("release manifest: {error}"))?;
|
||||
let body = String::from_utf8(body).map_err(|_| "release manifest was not UTF-8".to_string())?;
|
||||
|
||||
let parsed: serde_json::Value =
|
||||
serde_json::from_str(&body).map_err(|error| error.to_string())?;
|
||||
@@ -156,20 +159,24 @@ async fn fetch_latest(url: &str) -> Result<String, String> {
|
||||
Ok(normalized.to_string())
|
||||
}
|
||||
|
||||
/// Read a response body, refusing one that outgrows [`MAX_BODY_BYTES`].
|
||||
async fn bounded_body(response: reqwest::Response) -> Result<String, String> {
|
||||
/// Reads a response body, refusing one that outgrows `limit` bytes: what comes back is remote and
|
||||
/// untrusted, so a server that streams forever is cut off rather than exhausting memory.
|
||||
pub(crate) async fn bounded_bytes(
|
||||
response: reqwest::Response,
|
||||
limit: usize,
|
||||
) -> Result<Vec<u8>, String> {
|
||||
use futures::StreamExt;
|
||||
|
||||
let mut stream = response.bytes_stream();
|
||||
let mut body = Vec::new();
|
||||
while let Some(chunk) = stream.next().await {
|
||||
let chunk = chunk.map_err(|error| error.to_string())?;
|
||||
if body.len() + chunk.len() > MAX_BODY_BYTES {
|
||||
return Err("release manifest is implausibly large".to_string());
|
||||
if body.len() + chunk.len() > limit {
|
||||
return Err(format!("the response is larger than {limit} bytes"));
|
||||
}
|
||||
body.extend_from_slice(&chunk);
|
||||
}
|
||||
String::from_utf8(body).map_err(|_| "release manifest was not UTF-8".to_string())
|
||||
Ok(body)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user