Skip to content

Conversation

amio
Copy link
Contributor

@amio amio commented Sep 2, 2016

Currently the custom Content-Type in fn (for example):

const fetch = require('node-fetch')

module.exports = function (req, res) {
  return fetch('https://httpbin.org/ip').then(r => {
    res.setHeader('Content-Type', r.headers.get('Content-Type'))
    return r.body
  })
}

would be overridden by micro.send() method. This PR fix this :)

@leo leo added the enhancement label Sep 2, 2016
res.setHeader('Content-Type', 'application/octet-stream')
if (undefined === res.getHeader('Content-Type')) {
res.setHeader('Content-Type', 'application/octet-stream')
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an empty line after this statement.

@leo leo removed the enhancement label Sep 2, 2016
@leo leo self-assigned this Sep 2, 2016
@amio
Copy link
Contributor Author

amio commented Sep 2, 2016

@leo PR updated 💪

@leo
Copy link
Contributor

leo commented Sep 2, 2016

@amio 😘

@leo leo merged commit c2ab945 into vercel:master Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants