Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Bug: allow $respond to return custom Content-Type header #47

Closed
dylburger opened this issue Oct 24, 2019 · 2 comments
Closed

Bug: allow $respond to return custom Content-Type header #47

dylburger opened this issue Oct 24, 2019 · 2 comments
Labels
bug Something isn't working
Projects

Comments

@dylburger
Copy link
Contributor

Right now, Pipedream appends chartset=utf-8 to the Content-Type header returned with any HTTP response issued with$respond, even if I provide my own custom Content-Type header.

@dylburger dylburger added the bug Something isn't working label Oct 24, 2019
@jveres
Copy link

jveres commented Oct 30, 2019

This is expected to return an image, a single red pixel.

$respond({
    status: 200,
    headers: {'Content-Type': 'image/png'}, 
    body: Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg==', 'base64').toString()
})

Not sure if charset=utf-8 is the real issue, Content-Length mismatches as well in the response: 92 instead of 70.

@casret
Copy link

casret commented Oct 30, 2019

The body param will now correctly handle Buffer objects (do not convert it to a string).

A pixel is too small for me too see, but:
https://pipedream.com/new?template=p_95CBwD
renders:

https://enbt2igvz16wu8n.m.pipedream.net/?pipedream_response=1

@casret casret closed this as completed Oct 30, 2019
@dylburger dylburger added this to Shipped in Roadmap Oct 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Roadmap
  
Shipped
Development

No branches or pull requests

3 participants