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

webFetch response should return Response and Headers objects #380

@happybeing

Description

@happybeing

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)
      })
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions