mirror of
https://github.com/servo/servo.git
synced 2025-07-21 22:33:41 +01:00
script: Implement the Bytes() method on Request and Response (#35250)
* Implement the Bytes() method on Request and Response Signed-off-by: Shane Handley <shanehandley@fastmail.com> * avoid unsafe code during buffer creation Signed-off-by: Shane Handley <shanehandley@fastmail.com> --------- Signed-off-by: Shane Handley <shanehandley@fastmail.com>
This commit is contained in:
parent
f364b3f6ea
commit
938baf6bf3
10 changed files with 33 additions and 149 deletions
|
@ -386,6 +386,11 @@ impl ResponseMethods<crate::DomTypeHolder> for Response {
|
|||
fn ArrayBuffer(&self, can_gc: CanGc) -> Rc<Promise> {
|
||||
consume_body(self, BodyType::ArrayBuffer, can_gc)
|
||||
}
|
||||
|
||||
/// <https://fetch.spec.whatwg.org/#dom-body-bytes>
|
||||
fn Bytes(&self, can_gc: CanGc) -> std::rc::Rc<Promise> {
|
||||
consume_body(self, BodyType::Bytes, can_gc)
|
||||
}
|
||||
}
|
||||
|
||||
fn serialize_without_fragment(url: &ServoUrl) -> &str {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue