Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

copy all http request headers to outbound request #68

Merged
merged 1 commit into from

2 participants

@pksandeep

Hi,

TargetConnector is copying only the first HTTP header in the client request to outbound connection. I found out this issue while recording web service calls.

Please merge if it is fine.

Regards,
Sandeep

@robfletcher robfletcher merged commit 92ce137 into robfletcher:master
@robfletcher
Owner

Thanks. I can't believe I made such a stupid mistake. I'll do a 1.0.1 release later today to fix it.

@robfletcher robfletcher referenced this pull request from a commit
Rob Fletcher using `every` makes sense in the test for #68 5ce88d4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 11, 2012
  1. @pksandeep
This page is out of date. Refresh to see the latest.
View
2  src/main/groovy/co/freeside/betamax/proxy/handler/TargetConnector.groovy
@@ -40,7 +40,7 @@ class TargetConnector implements HttpHandler {
private HttpRequest createOutboundRequest(Request request) {
def outboundRequest = httpRequestFactory.newHttpRequest(request.method, request.uri.toString())
- request.headers.every { name, value ->
+ request.headers.each { name, value ->
outboundRequest.addHeader(name, value)
}
outboundRequest.addHeader(VIA, VIA_HEADER)
View
2  src/test/groovy/co/freeside/betamax/proxy/handler/TargetConnectorSpec.groovy
@@ -62,7 +62,7 @@ class TargetConnectorSpec extends Specification {
then:
1 * httpClient.execute(_, _) >> { httpHost, outboundRequest ->
- request.headers.every { name, value ->
+ request.headers.each { name, value ->
assert outboundRequest.getFirstHeader(name).value == value
}
okResponse
Something went wrong with that request. Please try again.