Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions crates/base/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl Service<Request<Body>> for WorkerService {
// If the token has already been canceled, return 503 instead of
// dropping the socket connection without a response.
if cancel.is_cancelled() {
error!("connection aborted (uri: {:?})", req_uri.to_string());
error!("connection aborted (uri: {})", req_uri);
return Ok(
Response::builder()
.status(http_v02::StatusCode::SERVICE_UNAVAILABLE)
Expand All @@ -262,8 +262,8 @@ impl Service<Request<Body>> for WorkerService {

Err(err) => {
error!(
"request failed (uri: {:?} reason: {:?})",
req_uri.to_string(),
"request failed (uri: {} reason: {:?})",
req_uri,
err
);

Expand Down
7 changes: 3 additions & 4 deletions ext/workers/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ pub struct UserWorkerBuiltRequest {
#[serde(rename_all = "camelCase")]
pub struct UserWorkerResponse {
status: u16,
status_text: String,
status_text: &'static str,
headers: Vec<(ByteString, ByteString)>,
body_rid: ResourceId,
size: Option<u64>,
Expand Down Expand Up @@ -654,16 +654,15 @@ pub async fn op_user_worker_fetch_send(
for (key, value) in res.headers().iter() {
headers.push((
ByteString::from(key.as_str()),
ByteString::from(value.to_str().unwrap_or_default()),
ByteString::from(value.as_bytes()),
));
}

let status = res.status().as_u16();
let status_text = res
.status()
.canonical_reason()
.unwrap_or("<unknown status code>")
.to_string();
.unwrap_or("<unknown status code>");

let size = HttpBody::size_hint(res.body()).exact();
let stream: BytesStream = Box::pin(res.into_body().map(|r| {
Expand Down