Commit 7fc28e2
authored
Add test for response constructor with body and status (#4641)
<!---
Thank you for contributing to Boa! Please fill out the template below,
and remove or add any
information as you feel necessary.
--->
This Pull Request fixes/closes #4547 .
Summary :- The `Response` constructor was a dummy implementation that
completely ignored its `body` and `options` parameters, always creating
an empty response with status 200. The constructor now properly parses
the `body` argument, reads `status` and `headers` from the options
object, validates the status code and returns `JsResult<Self>` to handle
errors .
Also added the "hello world" test mentioned in the issue for testing.1 parent cc7b25b commit 7fc28e2
1 file changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
0 commit comments