mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-03 08:24:19 +01:00
switch from Buffer to Vec<u8> for now as buffers are not supported by default in browser
This commit is contained in:
@@ -14,7 +14,7 @@ pub enum JsProtocolRequest {
|
||||
Http {
|
||||
method: String,
|
||||
path: String,
|
||||
body: Option<Buffer>,
|
||||
body: Option<Vec<u8>>,
|
||||
},
|
||||
FullRead {
|
||||
path: String,
|
||||
@@ -134,7 +134,7 @@ impl ProtocolIO for JsProtocolIo {
|
||||
Ok(self.add_request(JsProtocolRequest::Http {
|
||||
method: method.to_string(),
|
||||
path: path.to_string(),
|
||||
body: body.map(Buffer::from),
|
||||
body,
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ async function process(opts, request) {
|
||||
const response = await fetch(`${opts.url}${requestType.path}`, {
|
||||
method: requestType.method,
|
||||
headers: opts.headers,
|
||||
body: requestType.body
|
||||
body: requestType.body != null ? new Uint8Array(requestType.body) : null,
|
||||
});
|
||||
completion.status(response.status);
|
||||
const reader = response.body.getReader();
|
||||
|
||||
Reference in New Issue
Block a user