lambdaisland / lambdaisland/fetch

Unable to access raw body stream from fetch response

Open
#26 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
132
Forks
12
PR merge metrics
No merged PRs in 30d

Description

In js/fetch you can access the raw body as a stream like so:

(let [res (<p! (js/fetch endpoint #js{...}))]
  (-> res .-body (.pipe dest)))

However, similar to #25, in lambdaisland/fetch it's not possible to access the raw body because it's always decoded first.

https://github.com/lambdaisland/fetch/blob/1fe9fab75b47f5a245dfa105a87ffe8da539118d/src/lambdaisland/fetch.cljs#L115

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/lambdaisland/fetch.cljs around line 115 and compare its response handling with the raw js/fetch example in the issue and the discussion in #25. The change is complete when callers can access the response body as a raw stream without it being decoded first; verify the behavior with an appropriate fetch response test.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.