Skip to content

Commit

Permalink
feat: add support for null or undefined bodies in new Response
Browse files Browse the repository at this point in the history
…constructor
  • Loading branch information
johnyob authored and ryutamago committed Jul 5, 2024
1 parent f2eed1a commit 05c7594
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/jstz_api/src/http/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ impl NativeClass for ResponseClass {
context: &mut Context<'_>,
) -> JsResult<Self::Instance> {
let body: BodyWithType = match args.get(0) {
None | Some(JsValue::Undefined | JsValue::Null) => BodyWithType::default(),
Some(value) => value.try_js_into(context)?,
None => Default::default(),
};

let options: ResponseOptions = match args.get(1) {
Expand Down

0 comments on commit 05c7594

Please sign in to comment.