Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

webFetch response should return Response and Headers objects #380

Open
happybeing opened this issue Jul 21, 2019 · 0 comments
Open

webFetch response should return Response and Headers objects #380

happybeing opened this issue Jul 21, 2019 · 0 comments

Comments

@happybeing
Copy link

I suggest that SAFE webFetch() return Response and Headers objects because many clients will assume this. At the moment it returns simple objects, for example:

https://github.com/maidsafe/safe_app_nodejs/blob/72d68f51f6885e07a24975d62f4746e90befcd86/src/web_fetch.js#L466-L472

A workaround is the the client to do the conversion using a utility function such as:

  convertWebFetchResponse(wfr) {
      return new Response(wfr.body, {
        status: wfr.status,
        statusText: wfr.statusText,
        headers: new Headers(wfr.headers)
      })
  }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant