Skip to content

fetch: data url test fails #2579

@KhafraDev

Description

@KhafraDev

Caused by: de7dc7f

const { fetch } = require('./')
const assert = require('assert')

const input = "data:  ;charset=x   ;  base64,WA"
const expectedMimeType = "text/plain;charset=x"
const expectedBody = [88]

fetch(input).then(res => {
  return res.arrayBuffer().then(body => {
    assert.deepEqual(new Uint8Array(body), new Uint8Array(expectedBody))
    assert.equal(res.headers.get("content-type"), expectedMimeType)
  })
})

@tsctx

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions