Skip to content

Commit f0f393d

Browse files
ghivertlpil
authored andcommitted
Read rawBuffer for BitArray body instead of buffer
1 parent bacdee5 commit f0f393d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
- uses: erlef/setup-beam@v1
1919
with:
2020
otp-version: false
21-
gleam-version: "1.8.1"
21+
gleam-version: "1.9.1"
2222
- run: gleam test
2323
- run: gleam format --check src test

gleam.toml

+1-1
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

+3-3
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)