Skip to content

Commit

Permalink
sdk: export RedirectPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxiaohei committed Aug 31, 2023
1 parent 4040473 commit dbc0983
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/sdk/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ pub use super::fetch::fetch;
pub type RequestError = super::http_service::land::http::http_outgoing::RequestError;
/// `RequestOptions` is options for fetching request, including timeout and redirect policy.
pub type RequestOptions = super::http_service::land::http::http_outgoing::RequestOptions;
/// `RedirectPolicy` is redirect policy for fetching request.
pub type RedirectPolicy = super::http_service::land::http::http_types::RedirectPolicy;

/// `error_response` is a helper function to build a response with status code and message.
pub fn error_response(status: http::StatusCode, message: String) -> Response {
Expand Down
4 changes: 2 additions & 2 deletions crates/worker/src/hostcall/http_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Host for HttpContext {
return Ok(Ok((vec![], true))); // end of stream
}
let chunk = chunk.unwrap().unwrap();
debug!("read chunk: {}", chunk.len());
debug!("read chunk: {}, handle: {}", chunk.len(), handle);
Ok(Ok((chunk.to_vec(), false)))
}

Expand Down Expand Up @@ -84,4 +84,4 @@ impl Host for HttpContext {
debug!("new body stream: {}", body_handle);
Ok(Ok(body_handle))
}
}
}

0 comments on commit dbc0983

Please sign in to comment.