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

Multiple response headers with same name are not set on http response #35

Closed
steinfletcher opened this issue Sep 6, 2018 · 4 comments
Closed

Comments

@steinfletcher
Copy link
Contributor

steinfletcher commented Sep 6, 2018

I am trying to set multiple cookies with the same name on the gock response, but it always seems to only set the first cookie on the response object.

Am I doing something wrong - is there a better way to set cookies?

The mergeHeaders function appears to be the culprit. I have a solution and test here: steinfletcher@75ea39d

Thanks

@h2non
Copy link
Owner

h2non commented Sep 7, 2018

Right, in such case multiple headers should exist with the same key. Would you mind sending a PR? Thank you.

steinfletcher pushed a commit to steinfletcher/gock that referenced this issue Sep 7, 2018
@steinfletcher
Copy link
Contributor Author

steinfletcher commented Sep 7, 2018

Submitted PR, but a test fails in CI that I can't reproduce locally. Seems unrelated. It looks like tip fails, but tests run fine for me on go 1.11 (stable). Might be an option to run against stable instead of tip, but interesting that tip fails.

Many thanks.

steinfletcher pushed a commit to steinfletcher/gock that referenced this issue Sep 7, 2018
steinfletcher pushed a commit to steinfletcher/gock that referenced this issue Sep 8, 2018
steinfletcher pushed a commit to steinfletcher/gock that referenced this issue Sep 8, 2018
@h2non
Copy link
Owner

h2non commented Sep 9, 2018

Thanks for the PR!

New patch version is now available. Try upgrading the package.

@h2non h2non closed this as completed Sep 9, 2018
@steinfletcher
Copy link
Contributor Author

Thanks @h2non!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants