Skip to content

Commit ad7e0fd

Browse files
committed
Read rawBuffer for BitArray body instead of buffer
1 parent bacdee5 commit ad7e0fd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

gleam.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version = "1.2.0"
33
licences = ["Apache-2.0"]
44
description = "Make HTTP requests in Gleam JavaScript with Fetch"
55
target = "javascript"
6-
gleam = ">= 0.32.0"
6+
gleam = ">= 1.9.0"
77

88
repository = { type = "github", user = "gleam-lang", repo = "fetch" }
99
links = [

src/gleam_fetch_ffi.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function form_data_to_fetch_request(request) {
5151

5252
export function bitarray_request_to_fetch_request(request) {
5353
let [url, options] = request_common(request)
54-
if (options.method !== "GET" && options.method !== "HEAD") options.body = request.body.buffer;
54+
if (options.method !== "GET" && options.method !== "HEAD") options.body = request.body.rawBuffer;
5555
return new globalThis.Request(url, options);
5656
}
5757

@@ -116,13 +116,13 @@ export function setFormData(formData, key, value) {
116116

117117
export function appendBitsFormData(formData, key, value) {
118118
const f = cloneFormData(formData)
119-
f.append(key, new Blob([value.buffer]))
119+
f.append(key, new Blob([value.rawBuffer]))
120120
return f
121121
}
122122

123123
export function setBitsFormData(formData, key, value) {
124124
const f = cloneFormData(formData)
125-
f.set(key, new Blob([value.buffer]))
125+
f.set(key, new Blob([value.rawBuffer]))
126126
return f
127127
}
128128

0 commit comments

Comments
 (0)