Skip to content

Are you open to adding context expiration/cancellation support? #84

@wfscot

Description

@wfscot

Our HTTP proxy application uses contexts pretty extensively to implement timeouts. We also use (and love) gock throughout our unit tests.

I recently added some unit tests around timeouts and noticed in the process that gock does not support context expiration or cancellation. This makes the behavior different than what you'd get using the full HTTP stack. For an example, look here:
https://play.golang.org/p/rKOuNFphpBU (note that you can't run the non-gock version from the Playground)

I looked into the code and I think adding context support is a pretty easy change in response.go. Would you be open to a PR for that?

Thanks!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions