Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response headers sharing the same names get converted into a comma-separated list #1207

Closed
2 tasks done
jkbrzt opened this issue Nov 17, 2021 · 1 comment · Fixed by #1208
Closed
2 tasks done

Response headers sharing the same names get converted into a comma-separated list #1207

jkbrzt opened this issue Nov 17, 2021 · 1 comment · Fixed by #1208
Assignees
Labels
bug Something isn't working new Needs triage. Comments are welcome!
Milestone

Comments

@jkbrzt
Copy link
Member

jkbrzt commented Nov 17, 2021

Checklist

  • I've searched for similar issues.
  • I'm using the latest version of HTTPie.

Minimal reproduction code and steps

Make a request to URL that returns repeated headers lines. Here’s an example express server that does that:

// server.js
const express = require('express')
const fs = require('fs')

const app = express()
const port = 4000

app.get('/', (req, res) => {
  res.set('x-foo', ['bar', 'baz'])
  res.send('Hello World!')
})

app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`)
})

The run node server.js and get the response:

http :4000

Current result

x-foo: bar, baz

Expected result

x-foo: bar
x-foo: baz

@isidentical we’ve fixed this for requests, so let’s fix it for the responses as well.

@jkbrzt jkbrzt added bug Something isn't working new Needs triage. Comments are welcome! labels Nov 17, 2021
@isidentical isidentical self-assigned this Nov 17, 2021
@isidentical
Copy link
Contributor

Seems like this happen during the adapter, so we should be able to simply build our own HTTPAdapter and use the actual values from the urllib3's HeaderDict. Will send a patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new Needs triage. Comments are welcome!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants